diff --git a/Kompozycje/Kompozycje.py b/Kompozycje/Kompozycje.py index e7dbce4..c5faac3 100644 --- a/Kompozycje/Kompozycje.py +++ b/Kompozycje/Kompozycje.py @@ -330,7 +330,7 @@ def comps_order_change(self): def check_comps_order(self): if self.order_changed: - stoper = CustomMessageBox(self.dlg, + stoper = CustomMessageBox(None, tr( 'The order of the compositions has not been saved! Do you want to save it?')).button_yes_no() if stoper == QMessageBox.Yes: @@ -751,17 +751,27 @@ def run_comp_editor(self): self.dlg.wdol_warstwe.hide() self.dlg.wgore_warstwe.hide() self.wczytaj_grupy() + if Config().setts['font_changed']: + self.set_font_nowakompozycja(font_size()) if self.ustaw_okno(): if not self.dlg.isActiveWindow(): self.dlg.show() self.dlg.exec_() + def set_font_nowakompozycja(self, font_size): + self.dlg.frame.setStyleSheet( + f'{self.dlg.frame.styleSheet()} QFrame, QLabel, QWidget {{font: {font_size}pt;}}') + attributes = [self.dlg.frame_2, self.dlg.frame_3, self.dlg.frame_4, self.dlg.pushButton, + self.dlg.pushButton_2, self.dlg.label_3] + for attr in attributes: + attr.setStyleSheet(f'{attr.styleSheet()} font: {font_size}pt;') + def ustaw_okno(self): table = self.pokaz_kompozycje.dlg.tableView model = table.selectionModel() rows = model.selectedRows() if not rows: - CustomMessageBox(table, + CustomMessageBox(None, tr('Select composition to edit')).button_ok() return False name = rows[0].data(0) @@ -857,7 +867,7 @@ def run_comp_deleter(self): rows = model.selectedRows() if not rows: CustomMessageBox( - table, tr('Select composition to remove:') + None, tr('Select composition to remove:') ).button_ok() return diff --git a/Kompozycje/compositions_saver.ui b/Kompozycje/compositions_saver.ui index 8cd762c..9279203 100644 --- a/Kompozycje/compositions_saver.ui +++ b/Kompozycje/compositions_saver.ui @@ -36,11 +36,7 @@ :/plugins/GIAP-giap_layout/icons/giap_logo.png:/plugins/GIAP-giap_layout/icons/giap_logo.png - * { - background-color: rgb(53, 85, 109); - font: 10pt "Segoe UI"; - color: #EDF6FC; -} + QAbstractItemView { alternate-background-color: #e6e6e6; @@ -107,29 +103,6 @@ QLineEdit background-color: #4f5a63; } -QPushButton { - color: #0A0C0D; - border: 1px solid #0A0C0D; - background-color: #b7d3e8; - border-radius: 3px; - padding: 4px; -} - -QPushButton:hover { - - font-weight: bold; -} -QPushButton:pressed { - background-color: #5689b0; - border: 1px solid #6fb1e3; - font-weight: bold; -} - -QPushButton:disabled -{ - color: gray; -} - QTableView:item:selected { background-color: #6fb1e3; } @@ -269,11 +242,9 @@ border: 1px solid #5689b0; QGroupBox{ - border: None; -} -QPushButton:pressed{ - font-weight: bold; -} + border: None; + } + @@ -506,12 +477,10 @@ color: #0A0C0D; - * { -font: 75 8pt "Segoe UI Light"; -} -QFrame { -border-right: 2px solid #b7d3e8; -} + + QFrame { + border-right: 2px solid #b7d3e8; + } @@ -534,7 +503,6 @@ border-right: 2px solid #b7d3e8; background-color: #b7d3e8; color: #0A0C0D; - font: 10pt "Segoe UI"; font-weight: bold; diff --git a/Kompozycje/dodaj_kompozycje.ui b/Kompozycje/dodaj_kompozycje.ui index 7ebd469..290e995 100644 --- a/Kompozycje/dodaj_kompozycje.ui +++ b/Kompozycje/dodaj_kompozycje.ui @@ -39,11 +39,7 @@ :/plugins/GIAP-giap_layout/icons/giap_logo.png:/plugins/GIAP-giap_layout/icons/giap_logo.png - * { - background-color: rgb(53, 85, 109); - font: 10pt "Segoe UI"; - color: #EDF6FC; -} + QAbstractItemView { alternate-background-color: #e6e6e6; @@ -110,27 +106,6 @@ QLineEdit background-color: #4f5a63; } -QPushButton { - color: #0A0C0D; - border: 1px solid #0A0C0D; - background-color: #b7d3e8; - border-radius: 3px; - padding: 4px; -} - -QPushButton:hover { - font-weight: bold; -} -QPushButton:pressed { - background-color: #5689b0; - border: 1px solid #6fb1e3; -} - -QPushButton:disabled -{ - color: gray; -} - QGroupBox { border: 1px solid #5689b0; } @@ -194,9 +169,8 @@ QTableView:item:hover { - * { - color:#0A0C0D; -} + + QFrame::NoFrame @@ -513,12 +487,7 @@ color: #0A0C0D; - * { - background-color: rgb(53, 85, 109); - font: 10pt "Segoe UI"; - color: #EDF6FC; - -} + QAbstractItemView { alternate-background-color: #e6e6e6; @@ -585,27 +554,6 @@ QLineEdit background-color: #4f5a63; } -QPushButton { - color: #0A0C0D; - border: 1px solid #0A0C0D; - background-color: #b7d3e8; - border-radius: 3px; - padding: 4px; -} - -QPushButton:hover { - font-weight: bold; -} -QPushButton:pressed { - background-color: #5689b0; - border: 1px solid #6fb1e3; -} - -QPushButton:disabled -{ - color: gray; -} - QGroupBox { border: 1px solid #5689b0; } @@ -657,12 +605,8 @@ QListView:item:hover { false - * { - background-color: rgb(53, 85, 109); - font: 10pt "Segoe UI"; - color: #EDF6FC; + -} QAbstractItemView { alternate-background-color: #e6e6e6; @@ -729,27 +673,6 @@ QLineEdit background-color: #4f5a63; } -QPushButton { - color: #0A0C0D; - border: 1px solid #0A0C0D; - background-color: #b7d3e8; - border-radius: 3px; - padding: 4px; -} - -QPushButton:hover { - font-weight: bold; -} -QPushButton:pressed { - background-color: #5689b0; - border: 1px solid #6fb1e3; -} - -QPushButton:disabled -{ - color: gray; -} - QGroupBox { border: 1px solid #5689b0; } @@ -942,7 +865,6 @@ QListView:item:hover { * { - font: 75 8pt "Segoe UI Light"; color: #EDF6FC; } @@ -950,29 +872,6 @@ QFrame { border-right: 2px solid #b7d3e8; } -QPushButton { - font: 8pt "Segoe UI"; - color: #EDF6FC; - border: 1px solid #5689b0; - background-color: #4f5a63; - border-radius: 3px; - padding: 4px; - -} - -QPushButton:hover { - - font-weight: bold; -} -QPushButton:pressed { - background-color: #5689b0; - border: 1px solid #6fb1e3; -} - -QPushButton:disabled -{ - color: gray; -} @@ -992,33 +891,22 @@ QPushButton:disabled 5 - + - QPushButton{ - background-color: transparent; - font: 8pt "Segoe UI"; - padding-left: 5px; - padding-right: 5px; - border: None; - color: #EDF6FC; -} -QPushButton:hover{ - background-color: #b7d3e8; - border-radius:0 ; - font-weight: bold; - color: #0A0C0D; -} - -QPushButton:pressed{ - background-color: #b7d3e8; - border-radius:0 ; - font-weight: bold; - color: #0A0C0D; -} + + background-color: #b7d3e8; + color: #0A0C0D; + font-weight: bold; + padding-left: 5px; + padding-right: 5px; + User compositions + + Qt::AlignCenter + diff --git a/Kompozycje/nowa_kompozycja.py b/Kompozycje/nowa_kompozycja.py index 188dc80..0648c4f 100644 --- a/Kompozycje/nowa_kompozycja.py +++ b/Kompozycje/nowa_kompozycja.py @@ -28,9 +28,6 @@ def __init__(self, parent=None): self.uncheckPushButton.clicked.connect(self.uncheck) self.checkAllPushButton.clicked.connect(self.check_all) self.uncheckAllPushButton.clicked.connect(self.uncheck_all) - if Config().setts['font_changed']: - CustomMessageBox.stylesheet += \ - f'\n* {{font: {QSettings().value("qgis/stylesheet/fontPointSize")}pt}}' def check(self): try: @@ -44,7 +41,7 @@ def check(self): if not model.rowCount(): raise AttributeError("No layers in 'select layer'") except AttributeError: - CustomMessageBox(table, + CustomMessageBox(None, tr('No layers in select layers.')).button_ok() def uncheck(self): diff --git a/Kompozycje/nowa_kompozycja.ui b/Kompozycje/nowa_kompozycja.ui index 1a07e1a..8ceeaa5 100644 --- a/Kompozycje/nowa_kompozycja.ui +++ b/Kompozycje/nowa_kompozycja.ui @@ -45,11 +45,8 @@ :/plugins/GIAP-giap_layout/icons/giap_logo.png:/plugins/GIAP-giap_layout/icons/giap_logo.png - * { - background-color: rgb(53, 85, 109); - font: 10pt "Segoe UI"; - color: #EDF6FC; -} + + QAbstractItemView { alternate-background-color: #e6e6e6; @@ -116,27 +113,6 @@ QLineEdit background-color: #4f5a63; } -QPushButton { - color: #0A0C0D; - border: 1px solid #0A0C0D; - background-color: #b7d3e8; - border-radius: 3px; - padding: 4px; -} - -QPushButton:hover { - font-weight: bold; -} -QPushButton:pressed { - background-color: #5689b0; - border: 1px solid #6fb1e3; -} - -QPushButton:disabled -{ - color: gray; -} - QGroupBox { border: 1px solid #5689b0; } @@ -739,27 +715,6 @@ QLineEdit background-color: #4f5a63; } -QPushButton { - color: #0A0C0D; - border: 1px solid #0A0C0D; - background-color: #b7d3e8; - border-radius: 3px; - padding: 4px; -} - -QPushButton:hover { - font-weight: bold; -} -QPushButton:pressed { - background-color: #5689b0; - border: 1px solid #6fb1e3; -} - -QPushButton:disabled -{ - color: gray; -} - QGroupBox { border: 1px solid #5689b0; } @@ -1050,14 +1005,13 @@ QListView:item:hover { -* { - font: 75 8pt "Segoe UI Light"; - color: #0A0C0D; -} - -QFrame { - border-right: 2px solid #b7d3e8; -} + * { + color: #0A0C0D; + } + QFrame { + border-right: 2px solid #b7d3e8; + } + @@ -1078,7 +1032,6 @@ QFrame { background-color: #b7d3e8; color: #0A0C0D; - font: 10pt "Segoe UI"; font-weight: bold; padding-left: 5px; padding-right: 5px; diff --git a/OrtoTools.py b/OrtoTools.py index fc404f3..826cab6 100644 --- a/OrtoTools.py +++ b/OrtoTools.py @@ -26,9 +26,6 @@ def __init__(self, self.services = [] self.create_menu() self.connect_ortofotomapa_group() - if Config().setts['font_changed']: - CustomMessageBox.stylesheet += \ - f'\n* {{font: {QSettings().value("qgis/stylesheet/fontPointSize")}pt}}' def connect_ortofotomapa_group(self): """ diff --git a/Settings/ui_settings_layout.ui b/Settings/ui_settings_layout.ui index 10fb991..faf175f 100644 --- a/Settings/ui_settings_layout.ui +++ b/Settings/ui_settings_layout.ui @@ -40,10 +40,9 @@ * { - background-color: rgb(53, 85, 109); - font: 10pt "Segoe UI"; - color: #EDF6FC; + font: 10pt "Segoe UI"; } + QComboBox { selection-background-color: #b7d3e8; @@ -83,7 +82,7 @@ QComboBox::drop-down border-left-width: 0; border-left-color: #1a2936; border-left-style: solid; - border-top-right-radius: 3px; + border-top-right-radius: 3px; border-bottom-right-radius: 3px; } @@ -92,7 +91,7 @@ QComboBox::down-arrow image: url(icons/down_arrow_disabled.png); } -QComboBox::down-arrow:on, +QComboBox::down-arrow:on, QComboBox::down-arrow:hover, QComboBox::down-arrow:focus { @@ -106,28 +105,6 @@ QLineEdit background-color: #4f5a63; } -QPushButton { - color: #0A0C0D; - border: 1px solid #0A0C0D; - background-color: #b7d3e8; - border-radius: 3px; - padding: 4px; -} - -QPushButton:hover { - - font-weight: bold; -} -QPushButton:pressed { - background-color: #5689b0; - border: 1px solid #6fb1e3; -} - -QPushButton:disabled -{ - color: gray; -} - QGroupBox { border: 1px solid #5689b0; } @@ -421,18 +398,6 @@ p, li { white-space: pre-wrap; } - - - 0 - 0 - - - - - 200 - 0 - - Choose font size @@ -440,18 +405,6 @@ p, li { white-space: pre-wrap; } - - - 0 - 0 - - - - - 200 - 0 - - Restart font size @@ -635,10 +588,9 @@ p, li { white-space: pre-wrap; } background-color: #b7d3e8; - color: #0A0C0D; - font: 10pt "Segoe UI"; - font-weight: bold; - + color: #0A0C0D; + font-weight: bold; + diff --git a/StyleManager/ui_stylemanager.ui b/StyleManager/ui_stylemanager.ui index 4ea7e43..e2a2e22 100644 --- a/StyleManager/ui_stylemanager.ui +++ b/StyleManager/ui_stylemanager.ui @@ -36,10 +36,7 @@ :/plugins/GIAP-giap_layout/icons/giap_logo.png:/plugins/GIAP-giap_layout/icons/giap_logo.png - * { - background-color: rgb(53, 85, 109); - font: 10pt "Segoe UI"; -} + QListWidget { alternate-background-color: #e7e7e7; @@ -64,37 +61,10 @@ QAbstractItemView:selected background-color: rgb(38, 60, 78); } -QPushButton { - color: #0A0C0D; - border: 1px solid #0A0C0D; - background-color: #b7d3e8; - border-radius: 3px; - padding: 4px; -} - -QPushButton:hover { - - font-weight: bold; -} -QPushButton:pressed { - background-color: #5689b0; - border: 1px solid #6fb1e3; -} - -QPushButton:disabled -{ - color: gray; -} - QToolButton { color: #0A0C0D; } -QPushButton:disabled -{ - color: gray; -} - QHeaderView::section { background-color: #cfcfcf; diff --git a/giap_dynamic_layout.py b/giap_dynamic_layout.py index 3106623..a8fb01d 100644 --- a/giap_dynamic_layout.py +++ b/giap_dynamic_layout.py @@ -1161,7 +1161,7 @@ def __init__(self, lab: str, parent: QtWidgets=None) -> None: value = QSettings().value("qgis/stylesheet/fontPointSize") if \ self.conf.setts["font_changed"] else 10 self.setStyleSheet( - f'font:{value} "Segoe UI"; font-weight: normal; ' + f'font:{value}pt "Segoe UI"; font-weight: normal; ' ) self.cinput = QLineEdit(self) self.cinput.setWindowFlags(Qt.Popup) diff --git a/giap_layout.py b/giap_layout.py index dec0545..3822843 100644 --- a/giap_layout.py +++ b/giap_layout.py @@ -64,6 +64,7 @@ def __init__(self, iface: iface) -> None: self.iface.initializationCompleted.connect(self.load_ribbons) self.iface.newProjectCreated.connect(self.missingCorePlugins) self.set_dlg = SettingsDialog() + self.set_dlg.adjustSize() self.style_manager_dlg = StyleManagerDialog(self.style_manager) self.font_size = QSettings().value("qgis/stylesheet/fontPointSize") self.kompozycje = CompositionsTool(self.iface, self) diff --git a/utils.py b/utils.py index e828051..94f5906 100644 --- a/utils.py +++ b/utils.py @@ -4,7 +4,7 @@ from PyQt5.QtCore import Qt from qgis.PyQt import QtCore, QtGui -from qgis.PyQt.QtCore import QThread, QObject +from qgis.PyQt.QtCore import QThread, QObject, QSettings from qgis.PyQt.QtGui import QPen, QBrush, QIcon, QPixmap from qgis.PyQt.QtWidgets import QApplication, QProgressDialog, \ QStyledItemDelegate, QAction, QMessageBox, QScrollArea, QWidget, \ @@ -18,38 +18,9 @@ class CustomMessageBox(QMessageBox): stylesheet = """ - * { - background-color: rgb(53, 85, 109, 220); - color: rgb(255, 255, 255); - font: 10pt "Segoe UI"; - border: 0px; - } - QAbstractItemView { selection-background-color: rgb(87, 131, 167); } - - QPushButton { - border: none; - border-width: 2px; - border-radius: 6px; - background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(65, 97, 124, 255), stop:1 rgba(90, 135, 172, 255)); - padding: 5px 15px; - } - - QPushButton:checked { - background-color: qlineargradient(spread:pad, x1:1, y1:1, x2:1, y2:0, stop:0 rgba(65, 97, 124, 255), stop:1 rgba(31, 65, 90, 255)); - border: solid; - border-width: 2px; - border-color: rgb(65, 97, 124); - } - - QPushButton:pressed { - background-color: qlineargradient(spread:pad, x1:1, y1:1, x2:1, y2:0, stop:0 rgba(65, 97, 124, 255), stop:1 rgba(31, 65, 90, 255)); - border: solid; - border-width: 2px; - border-color: rgb(65, 97, 124); - } """ def __init__(self, parent=None, text='', image=''): @@ -59,6 +30,7 @@ def __init__(self, parent=None, text='', image=''): self.rebuild_layout(text, image) def rebuild_layout(self, text, image): + self.stylesheet = f'*{{font: {QSettings().value("qgis/stylesheet/fontPointSize")}pt;}} {self.stylesheet}' self.setStyleSheet(self.stylesheet) scrll = QScrollArea(self) @@ -148,6 +120,9 @@ def set_proper_size(self): scrll.horizontalScrollBar().setValue( int(scrll.horizontalScrollBar().maximum() / 2)) + def set_size(self, value: int) -> None: + self.stylesheet = f'*{{font: {value}pt;}} {self.stylesheet}' + self.setStyleSheet(self.stylesheet) class SingletonModel: __instance = None diff --git a/wydruk_dialog.ui b/wydruk_dialog.ui index e48cae4..4ed69b2 100644 --- a/wydruk_dialog.ui +++ b/wydruk_dialog.ui @@ -39,11 +39,12 @@ :/plugins/giap_layout/icons/giap_logo.png:/plugins/giap_layout/icons/giap_logo.png - * { - background-color: rgb(53, 85, 109); - font: 10pt "Segoe UI"; - color: #EDF6FC; -} + + + + + + QComboBox { selection-background-color: #6fb1e3; @@ -97,27 +98,27 @@ QLineEdit:focus{ border: 1px solid #5689B0; } -QPushButton { - color: #0A0C0D; - border: 1px solid #0A0C0D; - background-color: #b7d3e8; - border-radius: 3px; - padding: 4px; -} + + + + + + + -QPushButton:hover { + - font-weight: bold; -} -QPushButton:pressed { - background-color: #5689b0; - border: 1px solid #6fb1e3; -} + + + + + + -QPushButton:disabled -{ - color: gray; -} + + + + QGroupBox { border: 1px solid #5689b0; @@ -657,7 +658,7 @@ border: 1px solid #5689b0; background-color: #b7d3e8; color: #0A0C0D; - font: 10pt "Segoe UI"; + font-weight: bold;