From d7ae277cb0eb02b50cfdce69707bae68984e6955 Mon Sep 17 00:00:00 2001 From: klaudia Date: Wed, 20 Jul 2022 10:36:46 +0200 Subject: [PATCH 1/2] Task #16513. dopasowanie interfejsu pod skalowanie. Zmiana w pliku .ts --- Settings/ui_settings_layout.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Settings/ui_settings_layout.ui b/Settings/ui_settings_layout.ui index 10fb991..a6e8c01 100644 --- a/Settings/ui_settings_layout.ui +++ b/Settings/ui_settings_layout.ui @@ -448,7 +448,7 @@ p, li { white-space: pre-wrap; } - 200 + 300 0 From 777a1e6c0ef01b512bb20e4761fe70d3b8121405 Mon Sep 17 00:00:00 2001 From: klaudia Date: Fri, 22 Jul 2022 08:02:29 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Task=20#16513.=20Dopasowanie=20interfejsu?= =?UTF-8?q?=20pod=20skalowanie.=20Zmiana=20nazw=20widget=C3=B3w?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Kompozycje/Kompozycje.py | 41 ++++++++++++++++--------- Kompozycje/compositions_saver.ui | 14 ++++----- Kompozycje/dodajKompozycje.py | 4 +-- Kompozycje/dodaj_kompozycje.ui | 20 ++++++------ Kompozycje/nowa_kompozycja.ui | 20 ++++++------ QuickPrint.py | 9 +++--- SectionManager/CustomSectionManager.py | 14 ++++++++- SectionManager/UI/add_section_dialog.ui | 4 +-- Settings/ui_settings_layout.ui | 12 ++++---- StyleManager/ui_stylemanager.ui | 10 +++--- giap_layout.py | 20 ++++++------ wydruk_dialog.ui | 8 ++--- 12 files changed, 101 insertions(+), 75 deletions(-) diff --git a/Kompozycje/Kompozycje.py b/Kompozycje/Kompozycje.py index e7dbce4..6cabcc8 100644 --- a/Kompozycje/Kompozycje.py +++ b/Kompozycje/Kompozycje.py @@ -207,8 +207,8 @@ def run(self): self.dlg.dodaj_kompozycje.clicked.connect(self.dodaj) self.dlg.edytuj_kompozycje.clicked.connect(self.edytuj) self.dlg.usun_kompozycje.clicked.connect(self.usun) - self.dlg.zapisz.clicked.connect(self.write_file) - self.dlg.wczytaj.clicked.connect(self.read_file) + self.dlg.save.clicked.connect(self.write_file) + self.dlg.load.clicked.connect(self.read_file) self.dlg.komp_dol.clicked.connect(self.move_comp_down) self.dlg.komp_gora.clicked.connect(self.move_comp_up) self.model_kompozycji.rowsInserted.connect(self.comps_order_change) @@ -224,9 +224,12 @@ def run(self): self.save() def set_font_dodajkompozycje(self, font_size): - attributes = [self.dlg.pushButton_2, self.dlg.wczytaj, self.dlg.zapisz, self.dlg.frame_23, self.dlg.frame_24] + attributes = [self.dlg.pushButton_side, self.dlg.load, self.dlg.save, + self.dlg.frame_main, self.dlg.frame_title] for attr in attributes: - attr.setStyleSheet(f'{attr.styleSheet()} QPushButton, QLabel, QTableView {{font: {font_size}pt;}}; font: {font_size}pt;') + attr.setStyleSheet( + f'{attr.styleSheet()} QPushButton, QLabel, QTableView ' + f'{{font: {font_size}pt;}}; font: {font_size}pt;') def write_file(self): @@ -510,10 +513,10 @@ def run(self): self.write() def set_font_compositionsaver(self, font_size): - self.dlg.groupBox_11.setStyleSheet( - f'{self.dlg.groupBox_11.styleSheet()} QPushButton {{font: {font_size}pt;}}') - attributes = [self.dlg.label_2, self.dlg.pushButton_3, - self.dlg.title_label_12, self.dlg.frame_2] + self.dlg.groupBox_main.setStyleSheet( + f'{self.dlg.groupBox_main.styleSheet()} QPushButton {{font: {font_size}pt;}}') + attributes = [self.dlg.label_side, self.dlg.pushButton_cancel, + self.dlg.title_label, self.dlg.frame_compositions] for attr in attributes: attr.setStyleSheet(f'{attr.styleSheet()} font: {font_size}pt;') @@ -537,7 +540,7 @@ def run_comp_adder(self, order_no): self.kompozycje.dock, tr('No layers in project!')).button_ok() return self.dlg = NowaKompozycjaDialog() - self.dlg.pushButton_2.clicked.connect(self.save) + self.dlg.pushButton_save.clicked.connect(self.save) self.dlg.dodaj_warstwe.clicked.connect(self.add_layer) self.dlg.usun_warstwe.clicked.connect(self.del_layer) self.dlg.wdol_warstwe.clicked.connect(self.move_down) @@ -552,10 +555,10 @@ def run_comp_adder(self, order_no): 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] + self.dlg.frame_main.setStyleSheet( + f'{self.dlg.frame_main.styleSheet()} QFrame, QLabel, QWidget {{font: {font_size}pt;}}') + attributes = [self.dlg.frame_groups, self.dlg.frame_title, self.dlg.frame_layers, + self.dlg.pushButton_cancel, self.dlg.pushButton_save, self.dlg.label_side] for attr in attributes: attr.setStyleSheet(f'{attr.styleSheet()} font: {font_size}pt;') @@ -743,7 +746,7 @@ def run_comp_editor(self): self.root = QgsProject.instance().layerTreeRoot() self.dlg = NowaKompozycjaDialog() self.dlg.title_label_3.setText(tr('Edit')) - self.dlg.pushButton_2.clicked.connect(self.save) + self.dlg.pushButton_save.clicked.connect(self.save) self.dlg.dodaj_warstwe.clicked.connect(self.add_layer) self.dlg.usun_warstwe.clicked.connect(self.del_layer) self.dlg.wdol_warstwe.clicked.connect(self.move_down) @@ -751,11 +754,21 @@ 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_main.setStyleSheet( + f'{self.dlg.frame_main.styleSheet()} QFrame, QLabel, QWidget {{font: {font_size}pt;}}') + attributes = [self.dlg.frame_groups, self.dlg.frame_title, self.dlg.frame_layers, + self.dlg.pushButton_cancel, self.dlg.pushButton_save, self.dlg.label_side] + 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() diff --git a/Kompozycje/compositions_saver.ui b/Kompozycje/compositions_saver.ui index 8cd762c..6a6c387 100644 --- a/Kompozycje/compositions_saver.ui +++ b/Kompozycje/compositions_saver.ui @@ -229,7 +229,7 @@ border: 1px solid #5689b0; QFrame::Plain - + 10 @@ -266,7 +266,7 @@ border: 1px solid #5689b0; - + QGroupBox{ border: None; @@ -280,7 +280,7 @@ QPushButton:pressed{ - + border: 1px solid #0A0C0D; border-radius: 10px; @@ -459,7 +459,7 @@ color: #0A0C0D; - + 0 @@ -530,7 +530,7 @@ border-right: 2px solid #b7d3e8; 5 - + background-color: #b7d3e8; color: #0A0C0D; @@ -561,7 +561,7 @@ border-right: 2px solid #b7d3e8; verticalSpacer_3 - label_2 + label_side @@ -569,7 +569,7 @@ border-right: 2px solid #b7d3e8; - pushButton_3 + pushButton_cancel clicked() CompositionsSaverDialog reject() diff --git a/Kompozycje/dodajKompozycje.py b/Kompozycje/dodajKompozycje.py index 5e2f081..c35d8c3 100644 --- a/Kompozycje/dodajKompozycje.py +++ b/Kompozycje/dodajKompozycje.py @@ -17,5 +17,5 @@ def __init__(self, parent=None): self.dodaj_kompozycje.show() self.usun_kompozycje.show() - self.wczytaj.show() - self.zapisz.show() + self.load.show() + self.save.show() diff --git a/Kompozycje/dodaj_kompozycje.ui b/Kompozycje/dodaj_kompozycje.ui index 7ebd469..5409a84 100644 --- a/Kompozycje/dodaj_kompozycje.ui +++ b/Kompozycje/dodaj_kompozycje.ui @@ -225,7 +225,7 @@ QTableView:item:hover { 0 - + 200 @@ -295,7 +295,7 @@ QTableView:item:hover { - + QFrame::StyledPanel @@ -992,7 +992,7 @@ QPushButton:disabled 5 - + QPushButton{ background-color: transparent; @@ -1035,7 +1035,7 @@ QPushButton:pressed{ - + @@ -1045,7 +1045,7 @@ QPushButton:pressed{ - + color: #EDF6FC; @@ -1056,9 +1056,9 @@ QPushButton:pressed{ verticalSpacer_3 - zapisz - wczytaj - pushButton_2 + save + load + pushButton_side @@ -1068,8 +1068,8 @@ QPushButton:pressed{ komp_gora pushButton pushButton_3 - zapisz - wczytaj + save + load diff --git a/Kompozycje/nowa_kompozycja.ui b/Kompozycje/nowa_kompozycja.ui index 1a07e1a..32619be 100644 --- a/Kompozycje/nowa_kompozycja.ui +++ b/Kompozycje/nowa_kompozycja.ui @@ -237,7 +237,7 @@ QListView:item:hover { - + 120 @@ -266,7 +266,7 @@ QListView:item:hover { - + 120 @@ -297,7 +297,7 @@ QListView:item:hover { - + 0 @@ -336,7 +336,7 @@ QAbstractScrollArea:corner{ - + border: 1px solid #0A0C0D; border-radius: 10px; @@ -550,7 +550,7 @@ QScrollBar:vertical{ - + border: 1px solid #0A0C0D; border-radius: 10px; @@ -982,7 +982,7 @@ QListView:item:hover { - + 200 @@ -1074,7 +1074,7 @@ QFrame { - + background-color: #b7d3e8; color: #0A0C0D; @@ -1106,13 +1106,13 @@ QFrame { usun_warstwe wdol_warstwe wgore_warstwe - pushButton_2 - pushButton + pushButton_save + pushButton_cancel - pushButton + pushButton_cancel clicked() KompozycjeDialog reject() diff --git a/QuickPrint.py b/QuickPrint.py index 8cb1074..f3ae0fe 100644 --- a/QuickPrint.py +++ b/QuickPrint.py @@ -97,13 +97,14 @@ def __init__(self, iface : QgisInterface, parent : QtWidgets=None) -> None: self.set_font_quickprint(QSettings().value("qgis/stylesheet/fontPointSize")) def set_font_quickprint(self, font_size): - attributes = [self.dialog.label_2, self.dialog.title_label_7] + attributes = [self.dialog.label_side, self.dialog.title_label, + self.dialog.cancelPushButton, self.dialog.previewPushButton, + self.dialog.savePushButton, self.dialog.calendar] for attr in attributes: attr.setStyleSheet(f'{attr.styleSheet()} font: {font_size}pt;') - self.dialog.frame_4.setStyleSheet( - f'{self.dialog.frame_4.styleSheet()} QGroupBox, QCheckBox, QToolButton, ' + self.dialog.frame_main.setStyleSheet( + f'{self.dialog.frame_main.styleSheet()} QGroupBox, QCheckBox, QToolButton, ' f'QLineEdit, QRadioButton, QComboBox, QSpinBox, QProgressBar {{font: {font_size}pt;}}') - self.dialog.calendar.setStyleSheet(f'font: {font_size}pt;') def setup_rubberband(self) -> None: self.rubberband = QgsRubberBand(iface.mapCanvas(), QgsWkbTypes.PolygonGeometry) diff --git a/SectionManager/CustomSectionManager.py b/SectionManager/CustomSectionManager.py index 814e5d4..c638b02 100644 --- a/SectionManager/CustomSectionManager.py +++ b/SectionManager/CustomSectionManager.py @@ -5,7 +5,7 @@ from qgis.PyQt import uic from qgis.PyQt.QtCore import QModelIndex -from qgis.PyQt.QtCore import QSortFilterProxyModel +from qgis.PyQt.QtCore import QSortFilterProxyModel, QSettings from qgis.PyQt.QtGui import QStandardItemModel, QStandardItem from qgis.PyQt.QtWidgets import QDialog, QToolBar, QAction from qgis.utils import iface @@ -13,6 +13,7 @@ from ..utils import STANDARD_TOOLS, unpack_nested_lists, Qt, tr, \ icon_manager, CustomMessageBox, get_tool_label, GIAP_CUSTOM_TOOLS, get_action_from_toolbar, \ find_widget_with_menu_in_toolbar +from ..config import Config FORM_CLASS, _ = uic.loadUiType(os.path.join( os.path.dirname(__file__), 'UI/add_section_dialog.ui')) @@ -26,6 +27,8 @@ def __init__(self, parent=None, mode=None): self.main_qgs_widget = parent.parent self.mode = mode self.removed_idx = set() + if Config().setts['font_changed']: + self.set_font_custom_section_manager(QSettings().value("qgis/stylesheet/fontPointSize")) if mode != 'remove': self.add_available_tools_into_list() self.find_tool_searchbox.textChanged.connect( @@ -36,6 +39,15 @@ def __init__(self, parent=None, mode=None): self.pushButton_save.clicked.connect(self.save_section) self.protected = False + def set_font_custom_section_manager(self, font_size) -> None: + attributes = [self.pushButton_save, self.pushButton_cancel, self.title_label] + for attr in attributes: + attr.setStyleSheet(f'{attr.styleSheet()} font: {font_size}pt;') + self.frame_main.setStyleSheet( + f'{self.frame_main.styleSheet()}QFrame, QTableView, QLabel, QLineEdit, ' + f'QgsFilterLineEdit {{font: {font_size}pt;}}') + + def add_available_tools_into_list(self) -> None: self.availableToolTable_sort = QSortFilterProxyModel() model = QStandardItemModel() diff --git a/SectionManager/UI/add_section_dialog.ui b/SectionManager/UI/add_section_dialog.ui index d170672..6592fcd 100644 --- a/SectionManager/UI/add_section_dialog.ui +++ b/SectionManager/UI/add_section_dialog.ui @@ -212,7 +212,7 @@ QTreeView::branch { QFrame::Plain - + 8 @@ -240,7 +240,7 @@ QTreeView::branch { - + diff --git a/Settings/ui_settings_layout.ui b/Settings/ui_settings_layout.ui index a6e8c01..a758e4e 100644 --- a/Settings/ui_settings_layout.ui +++ b/Settings/ui_settings_layout.ui @@ -199,7 +199,7 @@ QRadioButton:selected{ 0 - + 200 @@ -250,7 +250,7 @@ QRadioButton:selected{ - + 0 @@ -350,7 +350,7 @@ QRadioButton:selected{ 20 - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> @@ -368,7 +368,7 @@ p, li { white-space: pre-wrap; } - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> @@ -632,7 +632,7 @@ p, li { white-space: pre-wrap; } 5 - + background-color: #b7d3e8; color: #0A0C0D; @@ -666,7 +666,7 @@ p, li { white-space: pre-wrap; } verticalSpacer_3 - label_2 + label_side diff --git a/StyleManager/ui_stylemanager.ui b/StyleManager/ui_stylemanager.ui index 4ea7e43..3e7abae 100644 --- a/StyleManager/ui_stylemanager.ui +++ b/StyleManager/ui_stylemanager.ui @@ -187,7 +187,7 @@ QHeaderView::section QFrame::Plain - + 10 @@ -215,7 +215,7 @@ QHeaderView::section - + QFrame::StyledPanel @@ -230,7 +230,7 @@ QHeaderView::section - + border: 1px solid #0A0C0D; border-radius: 10px; @@ -434,7 +434,7 @@ padding: 2px; 5 - + background-color: #b7d3e8; color: #0A0C0D; @@ -465,7 +465,7 @@ padding: 2px; verticalSpacer_3 - label_3 + label_side diff --git a/giap_layout.py b/giap_layout.py index dec0545..c22ba2b 100644 --- a/giap_layout.py +++ b/giap_layout.py @@ -76,28 +76,28 @@ def __init__(self, iface: iface) -> None: def setfont_settings_dialog(self) -> None: - self.set_dlg.frame_4.setStyleSheet( - f'{self.set_dlg.frame_4.styleSheet()}' + self.set_dlg.frame_main.setStyleSheet( + f'{self.set_dlg.frame_main.styleSheet()}' f' QGroupBox, QPushButton, QSpinBox, QRadioButton {{font: {self.font_size}pt;}}') - attributes = [self.set_dlg.frame_7, self.set_dlg.label_2] + attributes = [self.set_dlg.frame_title, self.set_dlg.label_side] for attr in attributes: attr.setStyleSheet(f'{attr.styleSheet()} font: {self.font_size}pt;') - attributes = [self.set_dlg.label, self.set_dlg.label_3] + attributes = [self.set_dlg.label_contact_left, self.set_dlg.label_contact_right] for attr in attributes: for repl in (re.findall(r'font-size:\d+', attr.text())): replaced = attr.text().replace(f'{repl}', f'font-size: {self.font_size}') attr.setText(replaced) def setfont_styles_dialog(self) -> None: - attributes = [self.style_manager_dlg.title_label_12, self.style_manager_dlg.pushButton_cancel, self.style_manager_dlg.label_3, - ] + attributes = [self.style_manager_dlg.title_label, self.style_manager_dlg.pushButton_cancel, + self.style_manager_dlg.label_side] for attr in attributes: attr.setStyleSheet(f'font: {self.font_size}pt;') - self.style_manager_dlg.frame_17.setStyleSheet( - f'{self.style_manager_dlg.frame_17.styleSheet()} QLabel, QPushButton {{font: {self.font_size}pt;}}') - self.style_manager_dlg.frame_2.setStyleSheet( - f'{self.style_manager_dlg.frame_2.styleSheet()}font: {self.font_size}pt;') + self.style_manager_dlg.frame_main.setStyleSheet( + f'{self.style_manager_dlg.frame_main.styleSheet()} QLabel, QPushButton {{font: {self.font_size}pt;}}') + self.style_manager_dlg.frame_style.setStyleSheet( + f'{self.style_manager_dlg.frame_style.styleSheet()}font: {self.font_size}pt;') def missingCorePlugins(self) -> None: if len(iface.mainWindow().findChild( diff --git a/wydruk_dialog.ui b/wydruk_dialog.ui index e48cae4..aac0982 100644 --- a/wydruk_dialog.ui +++ b/wydruk_dialog.ui @@ -209,7 +209,7 @@ border: 1px solid #5689b0; QFrame::Plain - + 10 @@ -237,7 +237,7 @@ border: 1px solid #5689b0; - + 0 @@ -653,7 +653,7 @@ border: 1px solid #5689b0; 5 - + background-color: #b7d3e8; color: #0A0C0D; @@ -684,7 +684,7 @@ border: 1px solid #5689b0; verticalSpacer_3 - label_2 + label_side