Class: Fliewr::StatusIcon
- Inherits:
-
Gtk::StatusIcon
- Object
- Gtk::StatusIcon
- Fliewr::StatusIcon
- Defined in:
- lib/fliewr/ui.rb
Instance Method Summary collapse
-
#initialize ⇒ StatusIcon
constructor
A new instance of StatusIcon.
Constructor Details
#initialize ⇒ StatusIcon
Returns a new instance of StatusIcon.
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/fliewr/ui.rb', line 183 def initialize super self.file = File.join(Fliewr::DATA_ROOT, 'pixmaps', 'fliewr.svg') self.set_tooltip 'Flickr Viewr' self.signal_connect(:activate) do if $gui.visible? $gui.minimize else $gui.move $cfg.get(:window_x_pos), $cfg.get(:window_y_pos) $gui.show.present end end = Gtk::Menu.new self.signal_connect(:popup_menu) do |icon, , time| .popup nil, nil, , time end separator = Gtk::SeparatorMenuItem.new item = Gtk::ImageMenuItem.new Gtk::Stock::HOME item.signal_connect(:activate) do $app.visit_user_profile end .append item item = Gtk::ImageMenuItem.new Gtk::Stock::REFRESH item.signal_connect(:activate) do $app.update end .append item item = Gtk::CheckMenuItem.new 'Always on top' item.signal_connect(:toggled) do || $gui.keep_above = .active? end .append item item = Gtk::ImageMenuItem.new Gtk::Stock::PREFERENCES item.signal_connect(:activate) do Fliewr::SettingsDialog.new end .append item item = Gtk::ImageMenuItem.new Gtk::Stock::ABOUT item.signal_connect(:activate) do AboutDialog.new end .append item .append separator item = Gtk::ImageMenuItem.new Gtk::Stock::QUIT item.signal_connect(:activate) do $app.quit end .append item .show_all end |