Add more icons

This commit is contained in:
heliguy
2024-07-05 21:57:37 -04:00
parent ba94a6266c
commit 5952147417
11 changed files with 200 additions and 9 deletions

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><g fill="#222222"><path d="m 4.003906 8.015625 c 0 0.261719 0.109375 0.515625 0.300782 0.703125 l 3 2.917969 c 0.386718 0.375 1.003906 0.375 1.394531 0 l 3 -2.917969 c 0.394531 -0.386719 0.402343 -1.019531 0.019531 -1.414062 c -0.386719 -0.398438 -1.019531 -0.40625 -1.414062 -0.019532 l -1.304688 1.265625 v -7.550781 c 0 -0.550781 -0.449219 -1 -1 -1 s -1 0.449219 -1 1 v 7.550781 l -1.300781 -1.265625 c -0.398438 -0.386718 -1.03125 -0.378906 -1.414063 0.019532 c -0.1875 0.1875 -0.289062 0.445312 -0.28125 0.710937 z m 0 0" fill-rule="evenodd"/><path d="m 1 15 h 14 v -2 h -14 z m 0 0"/></g></svg>

After

Width:  |  Height:  |  Size: 727 B

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><path d="m 4 0 c -1.644531 0 -3 1.355469 -3 3 v 10 c 0 1.644531 1.355469 3 3 3 h 8 c 1.644531 0 3 -1.355469 3 -3 v -10 c 0 -1.644531 -1.355469 -3 -3 -3 z m 0 2 h 8 c 0.570312 0 1 0.429688 1 1 v 4 h -10 v -4 c 0 -0.570312 0.429688 -1 1 -1 z m 2.464844 1.429688 c -0.019532 0 -0.039063 0.003906 -0.058594 0.007812 c -0.019531 0 -0.042969 0 -0.0625 0 c -0.214844 0.070312 -0.355469 0.273438 -0.34375 0.5 v 0.0625 c 0 0.546875 0.453125 1 1 1 h 2 c 0.546875 0 1 -0.453125 1 -1 v -0.0625 c 0.011719 -0.675781 -1.011719 -0.675781 -1 0 v 0.0625 h -2 v -0.0625 c 0.003906 -0.296875 -0.246094 -0.527344 -0.535156 -0.507812 z m -3.464844 4.570312 h 10 v 4 c 0 0.570312 -0.429688 1 -1 1 h -8 c -0.570312 0 -1 -0.429688 -1 -1 z m 3.464844 1.429688 c -0.019532 0 -0.039063 0.003906 -0.058594 0.007812 c -0.019531 0 -0.042969 0 -0.0625 0 c -0.214844 0.070312 -0.355469 0.273438 -0.34375 0.5 v 0.0625 c 0 0.546875 0.453125 1 1 1 h 2 c 0.546875 0 1 -0.453125 1 -1 v -0.0625 c 0.011719 -0.675781 -1.011719 -0.675781 -1 0 v 0.0625 h -2 v -0.0625 c 0.003906 -0.296875 -0.246094 -0.527344 -0.535156 -0.507812 z m 0 0" fill="#222222"/></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><g fill="#222222"><path d="m 10.875 10.0625 c -0.8125 0.148438 -1.105469 1.160156 -0.5 1.71875 l 3 3 c 0.957031 0.9375 2.363281 -0.5 1.40625 -1.4375 l -3 -3 c -0.234375 -0.238281 -0.574219 -0.347656 -0.90625 -0.28125 z m 0 0"/><path d="m 6.570312 0.0625 c -3.578124 0 -6.4999995 2.921875 -6.4999995 6.5 s 2.9218755 6.5 6.4999995 6.5 c 3.578126 0 6.5 -2.921875 6.5 -6.5 s -2.921874 -6.5 -6.5 -6.5 z m 0 2 c 2.5 0 4.5 2.003906 4.5 4.5 c 0 2.5 -2 4.5 -4.5 4.5 c -2.496093 0 -4.5 -2 -4.5 -4.5 c 0 -2.496094 2.003907 -4.5 4.5 -4.5 z m 0 0"/></g></svg>

After

Width:  |  Height:  |  Size: 673 B

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><path d="m 3 0 c -1.109375 0 -2 0.890625 -2 2 v 7 c 0 1.109375 0.890625 2 2 2 h 1 v 1 h -3 v 1 h 8.675781 l 1 -1 h -5.675781 v -1 h 1 c 1.109375 0 2 -0.890625 2 -2 v -7 c 0 -1.109375 -0.890625 -2 -2 -2 z m 8 0 c -1.109375 0 -2 0.890625 -2 2 v 7 c 0 1.109375 0.890625 2 2 2 h 3 c 1.109375 0 2 -0.890625 2 -2 v -7 c 0 -1.109375 -0.890625 -2 -2 -2 z m -8 2 h 3 v 1 h -3 z m 8 0 h 3 v 1 h -3 z m -8 2 h 3 v 5 h -3 z m 8 0 h 3 v 5 h -3 z m -7 1 v 1 h 1 v -1 z m 8 0 v 1 h 1 v -1 z m 0.503906 7 c -0.257812 0 -0.515625 0.097656 -0.710937 0.292969 l -2 2 c -0.183594 0.1875 -0.289063 0.441406 -0.285157 0.707031 h -0.007812 v 1 h 6.003906 v -1 h -0.003906 c 0 -0.265625 -0.101562 -0.519531 -0.289062 -0.707031 l -2 -2 c -0.195313 -0.195313 -0.449219 -0.292969 -0.707032 -0.292969 z m 0 0" fill="#222222"/></svg>

After

Width:  |  Height:  |  Size: 931 B

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><g fill="#222222"><path d="m 5 1 v 2.261719 c -1.609375 1.015625 -2.585938 2.785156 -2.585938 4.6875 v 0.050781 h -2.414062 l 7.925781 8.003906 l 8.074219 -8.003906 h -2.492188 c 0 -0.015625 0 -0.03125 0 -0.046875 c 0 -1.871094 -0.941406 -3.617187 -2.507812 -4.640625 v -2.3125 z m 2.867188 2.910156 h 0.09375 c 2.230468 0 4.039062 1.808594 4.039062 4.039063 c 0 2.234375 -1.808594 4.042969 -4.039062 4.042969 c -2.230469 0 -4.039063 -1.808594 -4.042969 -4.042969 c 0 -2.195313 1.753906 -3.988281 3.949219 -4.039063 z m 0 0"/><path d="m 8 4.5 c -0.550781 0 -1 0.449219 -1 1 v 2.863281 l 1.234375 1.46875 c 0.171875 0.207031 0.414063 0.332031 0.679687 0.355469 c 0.265626 0.023438 0.527344 -0.0625 0.730469 -0.230469 c 0.421875 -0.359375 0.476563 -0.988281 0.121094 -1.410156 l -0.765625 -0.910156 v -2.136719 c 0 -0.550781 -0.449219 -1 -1 -1 z m 0 0"/></g></svg>

After

Width:  |  Height:  |  Size: 989 B

View File

@@ -5,7 +5,7 @@ template $WarehouseWindow: Adw.ApplicationWindow {
title: "Warehouse";
// default-width: 240;
default-width: 865;
width-request: 360;
width-request: 400;
height-request: 360;
Adw.Breakpoint main_breakpoint {
condition ("min-width: 865")
@@ -31,6 +31,7 @@ template $WarehouseWindow: Adw.ApplicationWindow {
[start]
Button sidebar_button {
icon-name: "dock-left-symbolic";
tooltip-text: _("Hide Sidebar");
}
[end]
MenuButton main_menu {
@@ -41,9 +42,87 @@ template $WarehouseWindow: Adw.ApplicationWindow {
}
content:
ScrolledWindow {
ListBox {
Adw.ActionRow {
title: "test";
ListBox navigation_row_listbox {
styles ["navigation-sidebar"]
Box packages_row {
margin-top: 12;
margin-bottom: 12;
margin-start: 6;
margin-end: 6;
spacing: 12;
Image icon {
icon-name: "flatpak-symbolic";
}
Label {
label: _("Packages");
}
}
Box remotes_row {
margin-top: 12;
margin-bottom: 12;
margin-start: 6;
margin-end: 6;
spacing: 12;
Image {
icon-name: "server-pick-symbolic";
}
Label {
label: _("Remotes");
}
}
Box user_data_row {
margin-top: 12;
margin-bottom: 12;
margin-start: 6;
margin-end: 6;
spacing: 12;
Image {
icon-name: "file-manager-symbolic";
}
Label {
label: _("User Data");
}
}
Box snapshots_row {
margin-top: 12;
margin-bottom: 12;
margin-start: 6;
margin-end: 6;
spacing: 12;
Image {
icon-name: "snapshots-alt-symbolic";
}
Label {
label: _("Snapshots");
}
}
Box install_row {
margin-top: 12;
margin-bottom: 12;
margin-start: 6;
margin-end: 6;
spacing: 12;
Image {
icon-name: "arrow-pointing-at-line-down-symbolic";
}
Label {
label: _("Install Packages");
}
}
}
}

View File

@@ -33,13 +33,36 @@ class WarehouseWindow(Adw.ApplicationWindow):
main_breakpoint = gtc()
main_split = gtc()
sidebar_button = gtc()
navigation_row_listbox = gtc()
packages_row = gtc()
remotes_row = gtc()
user_data_row = gtc()
snapshots_row = gtc()
install_row = gtc()
def key_handler(self, controller, keyval, keycode, state):
if keyval == Gdk.KEY_w and state == Gdk.ModifierType.CONTROL_MASK:
self.close()
if keyval == Gdk.KEY_Escape:
self.batch_mode_button.set_active(False)
def navigation_handler(self, _, row, hide_sidebar=True):
row = row.get_child()
page = self.pages[row]
if hide_sidebar and self.main_split.get_collapsed():
self.main_split.set_show_sidebar(False)
if type(self.main_split.get_content()) == page:
# Skip when the user clicks on the row that is already showing the page
return
if page.instance:
self.main_split.set_content(page.instance)
else:
self.main_split.set_content(page(main_window=self))
def __init__(self, **kwargs):
super().__init__(**kwargs)
@@ -47,6 +70,9 @@ class WarehouseWindow(Adw.ApplicationWindow):
self.settings = Gio.Settings.new("io.github.flattool.Warehouse")
event_controller = Gtk.EventControllerKey()
file_drop = Gtk.DropTarget.new(Gio.File, Gdk.DragAction.COPY)
self.pages = {
self.packages_row: PackagesPage,
}
# Apply
self.settings.bind("window-width", self, "default-width", Gio.SettingsBindFlags.DEFAULT)
@@ -55,11 +81,15 @@ class WarehouseWindow(Adw.ApplicationWindow):
self.settings.bind("is-fullscreen", self, "fullscreened", Gio.SettingsBindFlags.DEFAULT)
self.add_controller(event_controller)
# self.scrolled_window.add_controller(file_drop)
self.main_split.set_content(PackagesPage(self))
# self.main_split.set_content(PackagesPage(self))
if Config.DEVEL:
self.add_css_class("devel")
# Connections
event_controller.connect("key-pressed", self.key_handler)
self.navigation_row_listbox.connect("row-activated", self.navigation_handler)
# file_drop.connect("drop", self.drop_callback)
self.sidebar_button.connect("clicked", lambda *_: self.main_split.set_show_sidebar(False))
self.sidebar_button.connect("clicked", lambda *_: self.main_split.set_show_sidebar(False))
self.navigation_row_listbox.get_row_at_index(0).activate()
self.main_split.set_show_sidebar(True)

View File

@@ -20,24 +20,83 @@ template $PackagesPage : Adw.BreakpointBin {
sidebar:
Adw.NavigationPage {
title: "Packages";
Adw.ToolbarView {
Adw.ToolbarView packages_tbv {
[top]
Adw.HeaderBar {
[start]
Button sidebar_button {
icon-name: "dock-left-symbolic";
visible: false;
tooltip-text: _("Show Sidebar");
}
[start]
ToggleButton search_button {
icon-name: "loupe-large-symbolic";
tooltip-text: _("Search Packages");
}
[start]
Button filter_button {
icon-name: "funnel-symbolic";
tooltip-text: _("Filter Packages");
}
[end]
Button refresh_button {
icon-name: "arrow-circular-top-right-symbolic";
tooltip-text: _("Refresh List");
}
[end]
ToggleButton select_button {
icon-name: "selection-mode-symbolic";
tooltip-text: _("Select Packages");
}
}
[top]
SearchBar search_bar {
search-mode-enabled: bind search_button.active bidirectional;
key-capture-widget: packages_tbv;
SearchEntry search_entry {
hexpand: true;
}
}
ScrolledWindow {
ListBox packages_list_box {
styles ["navigation-sidebar"]
}
}
[bottom]
Revealer {
reveal-child: bind select_button.active;
transition-type: slide_up;
[center]
Box {
styles ["toolbar"]
hexpand: true;
homogeneous: true;
Button {
styles ["raised"]
Adw.ButtonContent {
icon-name: "selection-mode-symbolic";
label: _("Select All");
can-shrink: true;
}
}
Button {
styles ["raised"]
Adw.ButtonContent {
icon-name: "edit-copy-symbolic";
label: _("Copy");
can-shrink: true;
}
}
Button {
styles ["raised"]
Adw.ButtonContent {
icon-name: "user-trash-symbolic";
label: _("Uninstall");
can-shrink: true;
}
}
}
}
}
}
;

View File

@@ -12,6 +12,11 @@ class PackagesPage(Adw.BreakpointBin):
refresh_button = gtc()
packages_list_box = gtc()
# Referred to in the main window
# It is used to determine if a new page should be made or not
# This must be set to the created object from within the class's __init__ method
instance = None
def generate_list(self, *args):
self.packages_list_box.remove_all()
for package in HostInfo.flatpaks:
@@ -28,10 +33,12 @@ class PackagesPage(Adw.BreakpointBin):
# Apply
HostInfo.get_flatpaks(callback=self.generate_list)
self.__class__.instance = self
# Connections
main_window.main_split.connect("notify::show-sidebar", lambda sidebar, *_: self.sidebar_button.set_visible(sidebar.get_collapsed() or not sidebar.get_show_sidebar()))
# main_window.main_split.connect("notify::collapsed", lambda sidebar, *_: self.sidebar_button.set_visible)
main_window.main_split.connect("notify::collapsed", lambda sidebar, *_: self.sidebar_button.set_visible(sidebar.get_collapsed() or not sidebar.get_show_sidebar()))
self.sidebar_button.connect("clicked", lambda *_: main_window.main_split.set_show_sidebar(True))
self.refresh_button.connect("clicked", lambda *_: HostInfo.get_flatpaks(callback=self.generate_list))
# self.packages_list_box.connect("row-selected", self.row_select_handler)

View File

@@ -33,5 +33,10 @@
<file preprocess="xml-stripblanks" alias="arrow-turn-left-down-symbolic.svg">../data/icons/arrow-turn-left-down-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="arrow-circular-top-right-symbolic.svg">../data/icons/arrow-circular-top-right-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="dock-left-symbolic.svg">../data/icons/dock-left-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="server-pick-symbolic.svg">../data/icons/server-pick-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="file-manager-symbolic.svg">../data/icons/file-manager-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="snapshots-alt-symbolic.svg">../data/icons/snapshots-alt-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="arrow-pointing-at-line-down-symbolic.svg">../data/icons/arrow-pointing-at-line-down-symbolic.svg</file>
<file preprocess="xml-stripblanks" alias="loupe-large-symbolic.svg">../data/icons/loupe-large-symbolic.svg</file>
</gresource>
</gresources>

View File

@@ -19,5 +19,6 @@ class AppRow(Adw.ActionRow):
self.set_subtitle(package.info["id"])
if package.icon_path:
self.image.set_from_file(package.icon_path)
self.image.add_css_class("icon-dropshadow")
# Connections