lib/rabbit/frame.rb in rabbit-2.1.9 vs lib/rabbit/frame.rb in rabbit-2.2.0
- old
+ new
@@ -55,18 +55,14 @@
def parse(source, callback=nil, &block)
@canvas.parse(source, callback, &block)
end
def fullscreen
- @fullscreen_toggled = false
- @fullscreen = true
@window.fullscreen
end
def unfullscreen
- @fullscreen_toggled = false
- @fullscreen = false
@window.unfullscreen
end
def toggle_fullscreen
if fullscreen?
@@ -75,15 +71,11 @@
fullscreen
end
end
def fullscreen?
- if @window.respond_to?(:fullscreen?)
- @window.fullscreen?
- else
- @fullscreen
- end
+ @fullscreen
end
def main_window?
@main_window
end
@@ -92,13 +84,11 @@
@window.title = Utils.unescape_title(new_title)
end
def init_gui(width, height, main_window, window_type=nil)
init_window(width, height, window_type)
- @fullscreen_toggled = false
@fullscreen = false
- @iconify = false
@main_window = main_window
if @main_window
@window.keep_above = @force_keep_above unless @force_keep_above.nil?
else
@window.keep_above = true
@@ -130,39 +120,37 @@
def set_window_signal
set_window_signal_window_state_event
set_window_signal_destroy
end
- def update_keep_above(keep_above=nil)
+ def update_keep_above(keep_above)
if @main_window
keep_above = @force_keep_above unless @force_keep_above.nil?
- @window.keep_above = keep_above unless keep_above.nil?
+ @window.keep_above = keep_above
else
@window.keep_above = true
end
end
def set_window_signal_window_state_event
@window.signal_connect("window_state_event") do |widget, event|
if event.changed_mask.fullscreen?
- @fullscreen_toggled = true
- if fullscreen?
+ @fullscreen = event.new_window_state.fullscreen?
+ if @fullscreen
@window.keep_above = true
@canvas.fullscreened
else
update_keep_above(false)
@canvas.unfullscreened
end
- @window.present
elsif event.changed_mask.iconified?
- if @iconify
- @iconify = false
- else
+ if event.new_window_state.iconified?
@canvas.iconified
- @iconify = true
end
end
+
+ false
end
end
def set_window_signal_destroy
@window.signal_connect("destroy") do
@@ -231,12 +219,10 @@
def init_gui(width, height, main_window, window_type=nil)
@window = Gtk::EventBox.new
@window.set_size_request(width, height)
@canvas.attach_to(self, @window)
- @fullscreen_toggled = false
@fullscreen = false
- @iconify = false
@main_window = main_window
@window.show
@canvas.post_init_gui
end
end