screen: dialogs should call fullscreen too for for use inside DEs
This commit is contained in:
parent
77ecae70b2
commit
ad3255b16a
@ -215,6 +215,8 @@ class KlippyGtk:
|
|||||||
dialog.set_resizable(False)
|
dialog.set_resizable(False)
|
||||||
dialog.set_transient_for(self.screen)
|
dialog.set_transient_for(self.screen)
|
||||||
dialog.set_modal(True)
|
dialog.set_modal(True)
|
||||||
|
if not self.screen.windowed:
|
||||||
|
dialog.fullscreen()
|
||||||
|
|
||||||
for button in buttons:
|
for button in buttons:
|
||||||
dialog.add_button(button['name'], button['response'])
|
dialog.add_button(button['name'], button['response'])
|
||||||
|
15
screen.py
15
screen.py
@ -92,6 +92,7 @@ class KlipperScreen(Gtk.Window):
|
|||||||
initialized = initializing = False
|
initialized = initializing = False
|
||||||
popup_timeout = None
|
popup_timeout = None
|
||||||
wayland = False
|
wayland = False
|
||||||
|
windowed = False
|
||||||
|
|
||||||
def __init__(self, args, version):
|
def __init__(self, args, version):
|
||||||
try:
|
try:
|
||||||
@ -122,12 +123,16 @@ class KlipperScreen(Gtk.Window):
|
|||||||
monitor = Gdk.Display.get_default().get_monitor(0)
|
monitor = Gdk.Display.get_default().get_monitor(0)
|
||||||
if monitor is None:
|
if monitor is None:
|
||||||
raise RuntimeError("Couldn't get default monitor")
|
raise RuntimeError("Couldn't get default monitor")
|
||||||
self.width = self._config.get_main_config().getint("width", monitor.get_geometry().width)
|
self.width = self._config.get_main_config().getint("width", None)
|
||||||
self.height = self._config.get_main_config().getint("height", monitor.get_geometry().height)
|
self.height = self._config.get_main_config().getint("height", None)
|
||||||
self.set_default_size(self.width, self.height)
|
if self.width or self.height:
|
||||||
self.set_resizable(True)
|
self.set_resizable(True)
|
||||||
if not (self._config.get_main_config().get("width") or self._config.get_main_config().get("height")):
|
self.windowed = True
|
||||||
|
else:
|
||||||
|
self.width = monitor.get_geometry().width
|
||||||
|
self.height = monitor.get_geometry().height
|
||||||
self.fullscreen()
|
self.fullscreen()
|
||||||
|
self.set_default_size(self.width, self.height)
|
||||||
self.aspect_ratio = self.width / self.height
|
self.aspect_ratio = self.width / self.height
|
||||||
self.vertical_mode = self.aspect_ratio < 1.0
|
self.vertical_mode = self.aspect_ratio < 1.0
|
||||||
logging.info(f"Screen resolution: {self.width}x{self.height}")
|
logging.info(f"Screen resolution: {self.width}x{self.height}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user