diff options
author | suchinton2001 <suchinton.2001@gmail.com> | 2023-10-26 18:11:52 +0530 |
---|---|---|
committer | suchinton2001 <suchinton.2001@gmail.com> | 2023-10-26 19:39:05 +0530 |
commit | bd1185376275b24ac00404c1f36c041e8ebb5e47 (patch) | |
tree | 8fe46cf8f19d33948ebcd073832ab45d8853ffdf /main.py | |
parent | ae721f6bb4ed29f2b7f4a54dc4e0c583f5fc7e21 (diff) |
agl-demo-control-panel: Add Fullscreen / maximized option
V1:
- Add fullscreen flag in config.ini to hide the header bar
and launch the control-center in fullscreen mode.
V2:
- Write default user-session config if not found in config.ini
Bug-AGL: SPEC-4948
Signed-off-by: suchinton2001 <suchinton.2001@gmail.com>
Change-Id: I549390711cdda95f99ee166d99c302176d105f1f
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -28,6 +28,8 @@ from PyQt5 import QtSvg from PyQt5.QtSvg import * from PyQt5.QtGui import QIcon +import extras.config as config + current_dir = os.path.dirname(os.path.abspath(__file__)) Form, Base = uic.loadUiType(os.path.join(current_dir, "Main_Window.ui")) @@ -55,6 +57,10 @@ class MainWindow(Base, Form): self.setAttribute(QtCore.Qt.WA_TranslucentBackground) self.setStyle(QtWidgets.QStyleFactory.create('Fusion')) + # set fullscreen mode if enabled in config.ini + if config.fullscreen_mode(): + UI_Handeler.fullscreen(self) + self.current_page = None self.headerContainer = self.findChild(QWidget, 'headerContainer') @@ -98,9 +104,8 @@ class MainWindow(Base, Form): self.settingsBtn) steering_icon = ":/Images/Images/steering-wheel.svg" - getsize = QtSvg.QSvgRenderer(steering_icon) svg_widget = QtSvg.QSvgWidget(steering_icon) - svg_widget.setFixedSize(getsize.defaultSize()) + svg_widget.setFixedSize(QtSvg.QSvgRenderer(steering_icon).defaultSize()) svg_widget.setStyleSheet("background-color: transparent;") self.steeringCtrlButton.setIcon(QIcon(svg_widget.grab())) |