Skip to content

Commit

Permalink
Task #16911. Dostosowanie interfejsu pod obecny wygląd - w oknach dia…
Browse files Browse the repository at this point in the history
…logowych
  • Loading branch information
klaudiamiekina committed Jul 21, 2022
1 parent 31e1388 commit 33e6277
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 375 deletions.
16 changes: 13 additions & 3 deletions Kompozycje/Kompozycje.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
48 changes: 8 additions & 40 deletions Kompozycje/compositions_saver.ui
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@
<normaloff>:/plugins/GIAP-giap_layout/icons/giap_logo.png</normaloff>:/plugins/GIAP-giap_layout/icons/giap_logo.png</iconset>
</property>
<property name="styleSheet">
<string notr="true">* {
background-color: rgb(53, 85, 109);
font: 10pt &quot;Segoe UI&quot;;
color: #EDF6FC;
}
<string notr="true">
QAbstractItemView
{
alternate-background-color: #e6e6e6;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -269,11 +242,9 @@ border: 1px solid #5689b0;
<widget class="QGroupBox" name="groupBox_11">
<property name="styleSheet">
<string notr="true">QGroupBox{
border: None;
}
QPushButton:pressed{
font-weight: bold;
}</string>
border: None;
}
</string>
</property>
<property name="title">
<string/>
Expand Down Expand Up @@ -506,12 +477,10 @@ color: #0A0C0D;
</font>
</property>
<property name="styleSheet">
<string notr="true">* {
font: 75 8pt &quot;Segoe UI Light&quot;;
}
QFrame {
border-right: 2px solid #b7d3e8;
}</string>
<string notr="true">
QFrame {
border-right: 2px solid #b7d3e8;
}</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
Expand All @@ -534,7 +503,6 @@ border-right: 2px solid #b7d3e8;
<property name="styleSheet">
<string notr="true"> background-color: #b7d3e8;
color: #0A0C0D;
font: 10pt &quot;Segoe UI&quot;;
font-weight: bold;
</string>
</property>
Expand Down
144 changes: 16 additions & 128 deletions Kompozycje/dodaj_kompozycje.ui
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@
<normaloff>:/plugins/GIAP-giap_layout/icons/giap_logo.png</normaloff>:/plugins/GIAP-giap_layout/icons/giap_logo.png</iconset>
</property>
<property name="styleSheet">
<string notr="true">* {
background-color: rgb(53, 85, 109);
font: 10pt &quot;Segoe UI&quot;;
color: #EDF6FC;
}
<string notr="true">
QAbstractItemView
{
alternate-background-color: #e6e6e6;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -194,9 +169,8 @@ QTableView:item:hover {
</font>
</property>
<property name="styleSheet">
<string notr="true">* {
color:#0A0C0D;
}</string>
<string notr="true">
</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
Expand Down Expand Up @@ -513,12 +487,7 @@ color: #0A0C0D;
</size>
</property>
<property name="styleSheet">
<string notr="true">* {
background-color: rgb(53, 85, 109);
font: 10pt &quot;Segoe UI&quot;;
color: #EDF6FC;

}
<string notr="true">
QAbstractItemView
{
alternate-background-color: #e6e6e6;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -657,12 +605,8 @@ QListView:item:hover {
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">* {
background-color: rgb(53, 85, 109);
font: 10pt &quot;Segoe UI&quot;;
color: #EDF6FC;
<string notr="true">

}
QAbstractItemView
{
alternate-background-color: #e6e6e6;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -942,37 +865,13 @@ QListView:item:hover {
<property name="styleSheet">
<string notr="true">
* {
font: 75 8pt &quot;Segoe UI Light&quot;;
color: #EDF6FC;
}

QFrame {
border-right: 2px solid #b7d3e8;
}

QPushButton {
font: 8pt &quot;Segoe UI&quot;;
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;
}
</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
Expand All @@ -992,33 +891,22 @@ QPushButton:disabled
<number>5</number>
</property>
<item>
<widget class="QPushButton" name="pushButton_2">
<widget class="QLabel" name="pushButton_2">
<property name="styleSheet">
<string notr="true">QPushButton{
background-color: transparent;
font: 8pt &quot;Segoe UI&quot;;
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;
}</string>
<string notr="true">
background-color: #b7d3e8;
color: #0A0C0D;
font-weight: bold;
padding-left: 5px;
padding-right: 5px;
</string>
</property>
<property name="text">
<string>User compositions</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
Expand Down
5 changes: 1 addition & 4 deletions Kompozycje/nowa_kompozycja.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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):
Expand Down
Loading

0 comments on commit 33e6277

Please sign in to comment.