Commit 4d0225a1 authored by Roman Alifanov's avatar Roman Alifanov

init TuneItPanelRow

parent 51a81b8a
# Please keep this file sorted alphabetically. # Please keep this file sorted alphabetically.
ru_RU
\ No newline at end of file
...@@ -6,6 +6,7 @@ from .daemon_client import dclient ...@@ -6,6 +6,7 @@ from .daemon_client import dclient
from .tools.yml_tools import load_modules, merge_categories_by_name from .tools.yml_tools import load_modules, merge_categories_by_name
from .tools.gvariant import convert_by_gvariant from .tools.gvariant import convert_by_gvariant
from .widgets import WidgetFactory from .widgets import WidgetFactory
from .widgets.panel_row import TuneItPanelRow
from .widgets.service_dialog import ServiceNotStartedDialog from .widgets.service_dialog import ServiceNotStartedDialog
...@@ -239,11 +240,11 @@ def init_settings_stack(stack, listbox, split_view): ...@@ -239,11 +240,11 @@ def init_settings_stack(stack, listbox, split_view):
pages = stack.get_pages() pages = stack.get_pages()
for i in range(pages.get_n_items()): for i in range(pages.get_n_items()):
page = pages.get_item(i) page = pages.get_item(i)
label = Gtk.Label(label=page.get_title(), xalign=0)
row = Gtk.ListBoxRow() row = TuneItPanelRow()
row.set_name(page.get_name()) row.set_name(page.get_name())
row.set_child(label) row.set_title(page.get_title())
row.icon_name = "preferences-system"
listbox.append(row) listbox.append(row)
......
using Gtk 4.0;
using Adw 1;
template $TuneItPanelRow: Adw.PreferencesRow {
child: Box {
spacing: 12;
margin-start: 6;
margin-end: 6;
margin-top: 12;
margin-bottom: 12;
Image thumbnail_image {
icon-name: bind template.icon-name;
}
Box {
orientation: vertical;
Label label {
label: bind template.title;
}
// Label sub_label {
// label: bind template.subtitle;
// styles [
// "caption"
// ]
// }
}
};
}
from gi.repository import GObject, Adw, Gtk
@Gtk.Template(resource_path='/ru.ximperlinux.TuneIt/settings/widgets/panel_row.ui')
class TuneItPanelRow(Adw.PreferencesRow):
__gtype_name__ = "TuneItPanelRow"
def __init__(self, **kwargs):
super().__init__(**kwargs)
@GObject.Property(type=str, default="")
def icon_name(self):
return self._icon_name
@icon_name.setter
def icon_name(self, icon_name):
self._icon_name = icon_name
@GObject.Property(type=str, default="")
def subtitle(self):
return self._subtitle
@subtitle.setter
def subtitle(self, subtitle):
self._subtitle = subtitle
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<gresources> <gresources>
<gresource prefix="/ru.ximperlinux.TuneIt"> <gresource prefix="/ru.ximperlinux.TuneIt">
<file preprocess="xml-stripblanks">window.ui</file> <file preprocess="xml-stripblanks">window.ui</file>
<file preprocess="xml-stripblanks">settings/widgets/panel_row.ui</file>
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file> <file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
</gresource> </gresource>
</gresources> </gresources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment