lib/screens/toolbox.rb in manabu-desktop-0.0.2 vs lib/screens/toolbox.rb in manabu-desktop-0.0.3
- old
+ new
@@ -1,10 +1,9 @@
require_relative 'base'
require_relative 'roster'
+require_relative '../tools'
require 'manabu/client'
-require 'emojidex-rasters'
-require 'emojidex/data/utf'
module ManabuDesktop
module Screens
class ToolBox < ManabuDesktop::Screens::Base
attr_reader :activities
@@ -17,11 +16,11 @@
@client = client
super('toolbox')
@activities = [:Roster, :Courses, :Exams, :Administration]
- icon_view = @builder.get_object('tools.icons')
+ icon_view = @builder.get_object('tools.IconView')
icon_view.set_pixbuf_column(ICON_COL)
icon_view.set_text_column(LABEL_COL)
list = Gtk::ListStore.new(GdkPixbuf::Pixbuf, String, String)
_fill_toolbox(list, icon_view)
@@ -39,21 +38,25 @@
_create_ability_icon(ability, list, icon_view)
end
end
def _create_ability_icon(ability, list, icon_view)
- emojidex = Emojidex::Data::UTF.new
case ability
when :Roster
- pixbuf = GdkPixbuf::Pixbuf.new(file: emojidex.emoji[:student].paths[:png][:px64])
+ pixbuf = GdkPixbuf::Pixbuf.new(
+ file: ManabuDesktop::Tools.emojidex.emoji[:student].paths[:png][:px64])
when :Courses
- pixbuf = GdkPixbuf::Pixbuf.new(file: emojidex.emoji[:notebook].paths[:png][:px64])
+ pixbuf = GdkPixbuf::Pixbuf.new(
+ file: ManabuDesktop::Tools.emojidex.emoji[:notebook].paths[:png][:px64])
when :Exams
- pixbuf = GdkPixbuf::Pixbuf.new(file: emojidex.emoji[:white_check_mark].paths[:png][:px64])
+ pixbuf = GdkPixbuf::Pixbuf.new(
+ file: ManabuDesktop::Tools.emojidex.emoji[:white_check_mark].paths[:png][:px64])
when :Administration
- pixbuf = GdkPixbuf::Pixbuf.new(file: emojidex.emoji[:wrench].paths[:png][:px64])
+ pixbuf = GdkPixbuf::Pixbuf.new(
+ file: ManabuDesktop::Tools.emojidex.emoji[:wrench].paths[:png][:px64])
else
- pixbuf = GdkPixbuf::Pixbuf.new(file: emojidex.emoji[:question].paths[:png][:px64])
+ pixbuf = GdkPixbuf::Pixbuf.new(
+ file: ManabuDesktop::Tools.emojidex.emoji[:question].paths[:png][:px64])
end
iter = list.append
list.set_value(iter, ICON_COL, pixbuf)
list.set_value(iter, LABEL_COL, I18n.t("g.#{ability.to_s}"))