mirror of
https://github.com/morgan9e/warehouse
synced 2026-04-14 00:04:08 +09:00
Add pills and margins
Make installed type text and EOL text be inside of pills to look better and more readable Increase margins at the top and bottom of the main list
This commit is contained in:
@@ -51,6 +51,7 @@ warehouse_sources = [
|
||||
'filter_window.py',
|
||||
'filter.blp',
|
||||
'popular_remotes_window.py',
|
||||
'style.css',
|
||||
]
|
||||
|
||||
install_data(warehouse_sources, install_dir: moduledir)
|
||||
|
||||
@@ -117,8 +117,9 @@ class OrphansWindow(Adw.Window):
|
||||
|
||||
for i in range(len(self.host_remotes)):
|
||||
remote_row = Adw.ActionRow(title=self.host_remotes[i][1])
|
||||
label = Gtk.Label(label=_("{} wide").format(self.host_remotes[i][7]))
|
||||
label = Gtk.Label(label=_("{} wide").format(self.host_remotes[i][7]), valign=Gtk.Align.CENTER)
|
||||
remote_select = Gtk.CheckButton()
|
||||
label.add_css_class("installType")
|
||||
remote_select_buttons.append(remote_select)
|
||||
remote_select.connect("toggled", remote_select_handler)
|
||||
remote_row.set_activatable_widget(remote_select)
|
||||
|
||||
@@ -77,8 +77,8 @@ class RemotesWindow(Adw.Window):
|
||||
if title == "-":
|
||||
remote_row.set_title(name)
|
||||
self.remotes_list.append(remote_row)
|
||||
label = Gtk.Label(label=("{} wide").format(install_type))
|
||||
label.add_css_class("subtitle")
|
||||
label = Gtk.Label(label=("{} wide").format(install_type), valign=Gtk.Align.CENTER)
|
||||
label.add_css_class("installType")
|
||||
remote_row.add_suffix(label)
|
||||
copy_button = Gtk.Button(icon_name="edit-copy-symbolic", valign=Gtk.Align.CENTER, tooltip_text=_("Copy remote name"))
|
||||
copy_button.add_css_class("flat")
|
||||
|
||||
21
src/style.css
Normal file
21
src/style.css
Normal file
@@ -0,0 +1,21 @@
|
||||
.eolText {
|
||||
background-color: #ff0000b7;
|
||||
color: #fafafa;
|
||||
border-radius: 1000px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.installType {
|
||||
background-color: #0077ffd0;
|
||||
color: #fafafa;
|
||||
border-radius: 1000px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
<file preprocess="xml-stripblanks">orphans.ui</file>
|
||||
<file preprocess="xml-stripblanks">filter.ui</file>
|
||||
<file preprocess="xml-stripblanks">popular_remotes.ui</file>
|
||||
<file>style.css</file>
|
||||
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
|
||||
<!-- <file preprocess="xml-stripblanks">../data/io.github.flattool.Warehouse.metainfo.xml.in</file> -->
|
||||
</gresource>
|
||||
|
||||
@@ -59,8 +59,8 @@ template WarehouseWindow : Adw.ApplicationWindow {
|
||||
vexpand: true;
|
||||
Adw.Clamp{
|
||||
ListBox flatpaks_list_box {
|
||||
margin-top: 6;
|
||||
margin-bottom: 24;
|
||||
margin-top: 18;
|
||||
margin-bottom: 18;
|
||||
margin-start: 12;
|
||||
margin-end: 12;
|
||||
hexpand: true;
|
||||
|
||||
@@ -120,7 +120,7 @@ class WarehouseWindow(Adw.ApplicationWindow):
|
||||
type_arr.append(app_type)
|
||||
self.removeRow(self.flatpak_rows[i])
|
||||
task = Gio.Task.new(None, None, self.uninstallFlatpakCallback)
|
||||
task.run_in_thread(lambda _task, _obj, _data, _cancellable, ref_arr=ref_arr, id_arr=id_arr, type_arr=type_arr ,should_trash=should_trash: self.uninstallFlatpakThread(ref_arr, id_arr, type_arr, should_trash))
|
||||
task.run_in_thread(lambda _task, _obj, _data, _cancellable, ref_arr=ref_arr, id_arr=id_arr, type_arr=type_arr, should_trash=should_trash: self.uninstallFlatpakThread(ref_arr, id_arr, type_arr, should_trash))
|
||||
|
||||
def batchUninstallButtonHandler(self, _widget):
|
||||
self.should_pulse = True
|
||||
@@ -287,16 +287,14 @@ class WarehouseWindow(Adw.ApplicationWindow):
|
||||
flatpak_row.set_subtitle(app_id)
|
||||
|
||||
if "eol" in self.host_flatpaks[index][12]:
|
||||
eol_runtime_label = Gtk.Label(label=_("Flatpak EOL"), tooltip_text=_("This Flatpak has reached its End of Life and will not receive any security updates"))
|
||||
eol_runtime_label.add_css_class("subtitle")
|
||||
eol_runtime_label.add_css_class("error")
|
||||
flatpak_row.add_suffix(eol_runtime_label)
|
||||
eol_app_label = Gtk.Label(label=_("Flatpak EOL"), valign=Gtk.Align.CENTER, tooltip_text=_("This Flatpak has reached its End of Life and will not receive any security updates"))
|
||||
eol_app_label.add_css_class("eolText")
|
||||
flatpak_row.add_suffix(eol_app_label)
|
||||
|
||||
if self.host_flatpaks[index][13] in self.eol_list:
|
||||
eol_app_label = Gtk.Label(label=_("Runtime EOL"), tooltip_text=_("The runtime used by this app has reached its End of Life and will not receive any security updates"))
|
||||
eol_app_label.add_css_class("subtitle")
|
||||
eol_app_label.add_css_class("error")
|
||||
flatpak_row.add_suffix(eol_app_label)
|
||||
eol_runtime_label = Gtk.Label(label=_("Runtime EOL"), valign=Gtk.Align.CENTER, tooltip_text=_("The runtime used by this app has reached its End of Life and will not receive any security updates"))
|
||||
eol_runtime_label.add_css_class("eolText")
|
||||
flatpak_row.add_suffix(eol_runtime_label)
|
||||
|
||||
properties_button = Gtk.Button(icon_name="info-symbolic", valign=Gtk.Align.CENTER, tooltip_text=_("View Properties"))
|
||||
properties_button.add_css_class("flat")
|
||||
@@ -352,10 +350,7 @@ class WarehouseWindow(Adw.ApplicationWindow):
|
||||
self.in_batch_mode = widget.get_active()
|
||||
self.batch_mode_bar.set_revealed(widget.get_active())
|
||||
|
||||
if widget.get_active():
|
||||
self.flatpaks_list_box.set_margin_bottom(6)
|
||||
else:
|
||||
self.flatpaks_list_box.set_margin_bottom(24)
|
||||
if not widget.get_active():
|
||||
self.batch_select_all_button.set_active(False)
|
||||
|
||||
def batchActionsEnable(self, should_enable):
|
||||
|
||||
Reference in New Issue
Block a user