Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into main_klaudiam_dostosowanie_ui

� Conflicts:
�	Kompozycje/Kompozycje.py
�	Kompozycje/dodaj_kompozycje.ui
�	Settings/ui_settings_layout.ui
  • Loading branch information
klaudiamiekina committed Jul 22, 2022
2 parents 33e6277 + 6208cea commit d90579e
Show file tree
Hide file tree
Showing 12 changed files with 96 additions and 80 deletions.
41 changes: 22 additions & 19 deletions Kompozycje/Kompozycje.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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):
Expand Down Expand Up @@ -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;')

Expand All @@ -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)
Expand All @@ -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;')

Expand Down Expand Up @@ -743,26 +746,26 @@ 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)
self.dlg.wgore_warstwe.clicked.connect(self.move_up)
self.dlg.wdol_warstwe.hide()
self.dlg.wgore_warstwe.hide()
self.wczytaj_grupy()
if Config().setts['font_changed']:
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]
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;')

Expand Down
14 changes: 7 additions & 7 deletions Kompozycje/compositions_saver.ui
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ border: 1px solid #5689b0;
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<widget class="QLabel" name="title_label_12">
<widget class="QLabel" name="title_label">
<property name="geometry">
<rect>
<x>10</x>
Expand Down Expand Up @@ -239,7 +239,7 @@ border: 1px solid #5689b0;
</property>
<layout class="QGridLayout" name="gridLayout_17">
<item row="0" column="1">
<widget class="QGroupBox" name="groupBox_11">
<widget class="QGroupBox" name="groupBox_main">
<property name="styleSheet">
<string notr="true">QGroupBox{
border: None;
Expand All @@ -251,7 +251,7 @@ border: 1px solid #5689b0;
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
<widget class="QFrame" name="frame_2">
<widget class="QFrame" name="frame_compositions">
<property name="styleSheet">
<string notr="true">border: 1px solid #0A0C0D;
border-radius: 10px;
Expand Down Expand Up @@ -430,7 +430,7 @@ color: #0A0C0D;
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_3">
<widget class="QPushButton" name="pushButton_cancel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
Expand Down Expand Up @@ -499,7 +499,7 @@ color: #0A0C0D;
<number>5</number>
</property>
<item>
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="label_side">
<property name="styleSheet">
<string notr="true"> background-color: #b7d3e8;
color: #0A0C0D;
Expand Down Expand Up @@ -529,15 +529,15 @@ color: #0A0C0D;
</item>
</layout>
<zorder>verticalSpacer_3</zorder>
<zorder>label_2</zorder>
<zorder>label_side</zorder>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>pushButton_3</sender>
<sender>pushButton_cancel</sender>
<signal>clicked()</signal>
<receiver>CompositionsSaverDialog</receiver>
<slot>reject()</slot>
Expand Down
4 changes: 2 additions & 2 deletions Kompozycje/dodajKompozycje.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
20 changes: 10 additions & 10 deletions Kompozycje/dodaj_kompozycje.ui
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ QTableView:item:hover {
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="frame_24">
<widget class="QFrame" name="frame_title">
<property name="minimumSize">
<size>
<width>200</width>
Expand Down Expand Up @@ -269,7 +269,7 @@ QTableView:item:hover {
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="frame_23">
<widget class="QFrame" name="frame_main">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
Expand Down Expand Up @@ -891,7 +891,7 @@ QFrame {
<number>5</number>
</property>
<item>
<widget class="QLabel" name="pushButton_2">
<widget class="QLabel" name="pushButton_side">
<property name="styleSheet">
<string notr="true">
background-color: #b7d3e8;
Expand Down Expand Up @@ -923,7 +923,7 @@ QFrame {
</spacer>
</item>
<item>
<widget class="QPushButton" name="zapisz">
<widget class="QPushButton" name="save">
<property name="styleSheet">
<string notr="true"/>
</property>
Expand All @@ -933,7 +933,7 @@ QFrame {
</widget>
</item>
<item>
<widget class="QPushButton" name="wczytaj">
<widget class="QPushButton" name="load">
<property name="styleSheet">
<string notr="true">color: #EDF6FC;</string>
</property>
Expand All @@ -944,9 +944,9 @@ QFrame {
</item>
</layout>
<zorder>verticalSpacer_3</zorder>
<zorder>zapisz</zorder>
<zorder>wczytaj</zorder>
<zorder>pushButton_2</zorder>
<zorder>save</zorder>
<zorder>load</zorder>
<zorder>pushButton_side</zorder>
</widget>
</item>
</layout>
Expand All @@ -956,8 +956,8 @@ QFrame {
<tabstop>komp_gora</tabstop>
<tabstop>pushButton</tabstop>
<tabstop>pushButton_3</tabstop>
<tabstop>zapisz</tabstop>
<tabstop>wczytaj</tabstop>
<tabstop>save</tabstop>
<tabstop>load</tabstop>
</tabstops>
<resources/>
<connections>
Expand Down
20 changes: 10 additions & 10 deletions Kompozycje/nowa_kompozycja.ui
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ QListView:item:hover {
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_2">
<widget class="QPushButton" name="pushButton_save">
<property name="minimumSize">
<size>
<width>120</width>
Expand Down Expand Up @@ -242,7 +242,7 @@ QListView:item:hover {
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<widget class="QPushButton" name="pushButton_cancel">
<property name="minimumSize">
<size>
<width>120</width>
Expand Down Expand Up @@ -273,7 +273,7 @@ QListView:item:hover {
</layout>
</item>
<item row="1" column="1">
<widget class="QFrame" name="frame">
<widget class="QFrame" name="frame_main">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
Expand Down Expand Up @@ -312,7 +312,7 @@ QAbstractScrollArea:corner{
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="1" rowspan="5">
<widget class="QFrame" name="frame_4">
<widget class="QFrame" name="frame_layers">
<property name="styleSheet">
<string notr="true">border: 1px solid #0A0C0D;
border-radius: 10px;
Expand Down Expand Up @@ -526,7 +526,7 @@ QScrollBar:vertical{
</widget>
</item>
<item row="1" column="0" rowspan="5">
<widget class="QFrame" name="frame_2">
<widget class="QFrame" name="frame_groups">
<property name="styleSheet">
<string notr="true">border: 1px solid #0A0C0D;
border-radius: 10px;
Expand Down Expand Up @@ -937,7 +937,7 @@ QListView:item:hover {
</widget>
</item>
<item row="0" column="1">
<widget class="QFrame" name="frame_3">
<widget class="QFrame" name="frame_title">
<property name="minimumSize">
<size>
<width>200</width>
Expand Down Expand Up @@ -1028,7 +1028,7 @@ QListView:item:hover {
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="label_side">
<property name="styleSheet">
<string notr="true"> background-color: #b7d3e8;
color: #0A0C0D;
Expand Down Expand Up @@ -1059,13 +1059,13 @@ QListView:item:hover {
<tabstop>usun_warstwe</tabstop>
<tabstop>wdol_warstwe</tabstop>
<tabstop>wgore_warstwe</tabstop>
<tabstop>pushButton_2</tabstop>
<tabstop>pushButton</tabstop>
<tabstop>pushButton_save</tabstop>
<tabstop>pushButton_cancel</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>pushButton</sender>
<sender>pushButton_cancel</sender>
<signal>clicked()</signal>
<receiver>KompozycjeDialog</receiver>
<slot>reject()</slot>
Expand Down
9 changes: 5 additions & 4 deletions QuickPrint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 13 additions & 1 deletion SectionManager/CustomSectionManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@

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

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'))
Expand All @@ -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(
Expand All @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions SectionManager/UI/add_section_dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ QTreeView::branch {
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<widget class="QLabel" name="title_label_12">
<widget class="QLabel" name="title_label">
<property name="geometry">
<rect>
<x>8</x>
Expand Down Expand Up @@ -240,7 +240,7 @@ QTreeView::branch {
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="frame_17">
<widget class="QFrame" name="frame_main">
<property name="styleSheet">
<string notr="true"/>
</property>
Expand Down
Loading

0 comments on commit d90579e

Please sign in to comment.