lib/volay/widget/system_tray.rb in volay-1.1.0 vs lib/volay/widget/system_tray.rb in volay-1.2.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
# Volay module
module Volay
# Widgets components
module Widget
# Events class
@@ -83,21 +85,19 @@
else
# left panel
posx = rectangle.x + rectangle.width
posy = rectangle.y
end
+ elsif rectangle.y + rectangle.height + window_height <=
+ monitor.y + monitor.height
+ posy = rectangle.y + rectangle.height
else
- total = rectangle.y + rectangle.height + window_height
- if total <= monitor.y + monitor.height
- posy = rectangle.y + rectangle.height
- else
- posy = rectangle.y - window_height
- posx = if rectangle.x + window_width <= monitor.x + monitor.width
- rectangle.x
- else
- monitor.x + monitor.width - window_width
- end
- end
+ posy = rectangle.y - window_height
+ posx = if rectangle.x + window_width <= monitor.x + monitor.width
+ rectangle.x
+ else
+ monitor.x + monitor.width - window_width
+ end
end
[posx, posy]
end
end