Add separate styling for template editor QGroupBoxes (#2337)

* Add separate styling for template editor GroupBoxes

* Fix title alignment and padding
This commit is contained in:
Matthias Metelka 2023-01-19 12:14:52 +01:00 committed by GitHub
parent 8730092190
commit e32b3a7fe5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View file

@ -247,7 +247,7 @@ class CardLayout(QDialog):
tform.front_button.setText(tr.card_templates_front_template())
tform.back_button.setText(tr.card_templates_back_template())
tform.style_button.setText(tr.card_templates_template_styling())
tform.groupBox.setTitle(tr.card_templates_template_box())
tform.template_box.setTitle(tr.card_templates_template_box())
cnt = self.mw.col.models.use_count(self.model)
tform.changes_affect_label.setText(

View file

@ -33,7 +33,7 @@
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox">
<widget class="QGroupBox" name="template_box">
<property name="title">
<string notr="true">GroupBox</string>
</property>

View file

@ -88,11 +88,21 @@ class CustomStyles:
border-radius: {tm.var(props.BORDER_RADIUS)};
margin-top: 10px;
}}
QGroupBox#preview_box,
QGroupBox#template_box {{
background: none;
border: none;
}}
QGroupBox::title {{
subcontrol-origin: margin;
subcontrol-position: top left;
margin: 0 2px;
left: 15px;
}}
QGroupBox#preview_box::title,
QGroupBox#template_box::title {{
margin-top: 5px;
left: 5px;
}}
"""