Skip to content

Commit af1af20

Browse files
committed
Improved Global Config
result of Ura Design audit
1 parent 0c0db19 commit af1af20

File tree

12 files changed

+906
-873
lines changed

12 files changed

+906
-873
lines changed

icons/scalable/qubes-add.svg

Lines changed: 5 additions & 0 deletions
Loading

icons/scalable/qubes-info.svg

Lines changed: 4 additions & 3 deletions
Loading

qubes_config/global_config.glade

Lines changed: 803 additions & 832 deletions
Large diffs are not rendered by default.

qubes_config/global_config/policy_handler.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def __init__(
9898
self.include_adminvm = include_admin_vm
9999

100100
# main widgets
101+
self.custom_settings_box: Gtk.Box = gtk_builder.get_object(
102+
f"{prefix}_custom_box"
103+
)
104+
101105
self.main_list_box: Gtk.ListBox = gtk_builder.get_object(
102106
f"{prefix}_main_list"
103107
)
@@ -281,7 +285,8 @@ def populate_rule_lists(self, rules: List[Rule]):
281285
self.check_custom_rules(rules)
282286

283287
def set_custom_editable(self, state: bool):
284-
"""If true, set widgets to accept editing custom rules."""
288+
"""If true, set widgets to accept editing custom rules and show them."""
289+
self.custom_settings_box.set_visible(state)
285290
self.add_button.set_sensitive(state)
286291
self.main_list_box.set_sensitive(state)
287292
self.exception_list_box.set_sensitive(state)

qubes_config/global_config/rule_list_widgets.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def __init__(
112112
)
113113

114114
self.combobox: Gtk.ComboBox = Gtk.ComboBox.new_with_entry()
115+
self.combobox.get_style_context().add_class('flat_combo')
115116
self.combobox.get_child().set_width_chars(24)
116117
self.model = VMListModeler(
117118
combobox=self.combobox,
@@ -140,10 +141,10 @@ def __init__(
140141
additional_text_widget = Gtk.Label()
141142
additional_text_widget.set_text(additional_text)
142143
additional_text_widget.get_style_context().add_class("didascalia")
143-
additional_text_widget.set_halign(Gtk.Align.END)
144+
additional_text_widget.set_halign(Gtk.Align.CENTER)
144145
self.pack_end(additional_text_widget, False, False, 0)
145146
if additional_widget:
146-
additional_widget.set_halign(Gtk.Align.END)
147+
additional_widget.set_halign(Gtk.Align.CENTER)
147148
self.pack_end(additional_widget, False, False, 0)
148149

149150
self.set_editable(False)
@@ -385,8 +386,8 @@ def __init__(
385386
click_function=self.revert,
386387
style_classes=["button_cancel", "flat_button"],
387388
)
388-
self.additional_widget_box.pack_end(save_button, False, False, 10)
389-
self.additional_widget_box.pack_end(cancel_button, False, False, 10)
389+
self.additional_widget_box.pack_start(save_button, False, False, 10)
390+
self.additional_widget_box.pack_start(cancel_button, False, False, 10)
390391

391392
self.additional_widget_box.set_no_show_all(True)
392393
self.outer_box.pack_start(self.additional_widget_box, False, False, 10)

qubes_config/global_config/updates_handler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ def __init__(self, gtk_builder: Gtk.Builder, qapp: qubesadmin.Qubes):
259259
"updates_check_exception_label"
260260
)
261261

262+
263+
262264
self.initial_dom0 = get_boolean_feature(
263265
self.qapp.domains["dom0"], self.FEATURE_NAME, True
264266
)
@@ -307,15 +309,13 @@ def _set_label(self):
307309
if self.enable_radio.get_active():
308310
self.exception_label.set_markup(
309311
_(
310-
"Except the following qubes, for which checking for updates"
311-
" will be <b>disabled</b>"
312+
"<b>disabled</b>"
312313
)
313314
)
314315
else:
315316
self.exception_label.set_markup(
316317
_(
317-
"Except the following qubes, for which checking for updates"
318-
" will be <b>enabled</b>"
318+
"<b>enabled</b>"
319319
)
320320
)
321321

qubes_config/global_config/vm_flowbox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __init__(self, vm: qubesadmin.vm.QubesVM):
7070
box.pack_start(token_widget, False, False, 0)
7171
remove_icon = Gtk.Image()
7272
remove_icon.set_from_pixbuf(load_icon("qubes-delete", 14, 14))
73-
box.pack_start(remove_icon, False, False, 10)
73+
box.pack_start(remove_icon, False, False, 0)
7474

7575
button.add(box)
7676
button.connect("clicked", self._remove_self)

qubes_config/qubes-global-config-base.css

Lines changed: 48 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
separator {
22
background: @separator-color;
3+
border-top: 1px solid @dark-gray-2;
4+
margin-top: 5px;
5+
margin-bottom: 5px;
36
}
47

58
.combo {
6-
padding: 2px;
9+
padding: 2px 2px 2px 10px;
10+
background: @top-background;
11+
border-width: 1px;
12+
border-color: @background-frame
13+
}
14+
15+
.flat_combo button.combo {
16+
border-left: 0px;
717
}
818

919
.qubes_version_label {
@@ -64,6 +74,15 @@ separator {
6474
.section_title {
6575
margin-top: 10px;
6676
margin-bottom: 2px;
77+
font-weight: 600;
78+
font-size: 150%;
79+
}
80+
81+
.page_title {
82+
font-weight: 400;
83+
font-size: 180%;
84+
margin-top: 20px;
85+
margin-bottom: 2px;
6786
}
6887

6988
.flowbox_container {
@@ -100,17 +119,25 @@ separator {
100119
}
101120

102121
.add_label {
103-
color: @qubes-blue;
104-
font-weight: bold;
122+
color: @text-color;
123+
font-weight: 600;
124+
font-size: 100%;
105125
}
106126

107127
.add_label:disabled {
108-
color: @misc-text-color;
109-
font-weight: bold;
128+
color: @soft-text-color;
129+
font-size: 100%;
130+
font-weight: 600;
110131
}
111132

112133
.add_button {
113-
border: 0;
134+
border-image: none;
135+
background-image: none;
136+
border: 2px;
137+
border-style: solid;
138+
border-color: @medium-gray-2;
139+
background: @add-button;
140+
box-shadow: none;
114141
}
115142

116143
.permission_list {
@@ -130,10 +157,8 @@ separator {
130157

131158
.edited_row {
132159
padding: 5px 5px 5px 5px;
133-
background: @top-background;
134-
border-color: @background-frame;
135-
border-style: solid;
136-
border-width: 1px;
160+
background: none;
161+
border-style: none;
137162
margin: 5px;
138163
}
139164

@@ -142,11 +167,12 @@ separator {
142167
}
143168

144169
.problem_box {
145-
margin: 5px 80px 5px 40px;
170+
margin: 5px 0px 5px 0px;
146171
padding: 10px;
147-
border: 1px;
172+
border-width: 2px;
148173
border-style: solid;
149-
border-color: @background-frame;
174+
border-radius: 4px;
175+
border-color: @problem-frame;
150176
background: @problem-background;
151177
}
152178

@@ -197,12 +223,17 @@ separator {
197223
}
198224

199225
.info_box {
200-
padding: 10px 20px 10px 20px;
201-
margin: 5px 50px 5px 30px;
226+
padding: 10px 10px 10px 10px;
227+
margin: 5px 0px 5px 0px;
202228
background: @info-background;
203-
border-width: 1px;
229+
border-width: 2px;
204230
border-style: solid;
205-
border-color: @background-frame;
231+
border-radius: 4px;
232+
border-color: @info-frame;
233+
}
234+
235+
.info_box link {
236+
color: @link-color;
206237
}
207238

208239
.action_text {

qui/styles/qubes-colors-dark.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
@define-color qubes-blue #4180c9;
22
@define-color dark-blue #4488df;
3+
@define-color blue-100 #dbeafe;
34

45
@define-color dark-gray-2 #858585;
56
@define-color dark-gray #cdcdcd;
67
@define-color medium-gray #979797;
7-
@define-color medium-gray-2 #e7e7e7;
8-
@define-color light-gray #f2f2f2;
8+
@define-color medium-gray-2 #e5e7eb;
9+
@define-color light-gray #f2f4f6;
910

1011
@define-color top-background #181818;
1112
@define-color top-background-2 #292929;
@@ -16,9 +17,14 @@
1617
@define-color soft-text-color #e7e7e7;
1718
@define-color misc-text-color #f2f2f2;
1819

19-
@define-color problem-background #614942;
20+
@define-color problem-background #991b1b;
21+
@define-color problem-frame #dc2626;
2022

21-
@define-color info-background #6e5f54;
23+
@define-color info-background #a16207;
24+
@define-color info-frame #a16207;
25+
@define-color link-color #1d4ed8;
26+
27+
@define-color add-button #9ca3af;
2228

2329
@define-color text-color #ffffff;
2430
@define-color dark-text-color #000000;

qui/styles/qubes-colors-light.css

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11
@define-color qubes-blue #4180c9;
22
@define-color dark-blue #4488df;
3+
@define-color blue-100 #dbeafe;
34

45
@define-color dark-gray-2 #858585;
56
@define-color dark-gray #cdcdcd;
67
@define-color medium-gray #979797;
7-
@define-color medium-gray-2 #e7e7e7;
8-
@define-color light-gray #f2f2f2;
8+
@define-color medium-gray-2 #e5e7eb;
9+
@define-color light-gray #f3f4f6;
910

1011
@define-color top-background #ffffff;
11-
@define-color top-background-2 #f2f2f2;
12+
@define-color top-background-2 #f9fafb;
1213
@define-color bottom-background #858585;
1314
@define-color background-frame #979797;
1415
@define-color button-color #f2f2f2;
1516
@define-color separator-color #cdcdcd;
1617
@define-color soft-text-color #858585;
1718
@define-color misc-text-color #979797;
1819

19-
@define-color problem-background #fce9e3;
20+
@define-color problem-background #fecaca;
21+
@define-color problem-frame #b91c1c;
2022

21-
@define-color info-background #f0e9e3;
23+
@define-color info-background #fef3c7;
24+
@define-color info-frame #a16207;
25+
@define-color link-color #2563eb;
26+
27+
@define-color add-button #f3f4f6;
2228

2329
@define-color text-color #000000;
2430
@define-color dark-text-color #000000;

0 commit comments

Comments
 (0)