Commit 6ca987db authored by Vladimir Vaskov's avatar Vladimir Vaskov

Merge branch 'master' into 'master'

Impove UI See merge request !2
parents a39b8ab4 2f7d6d18
project('tuneit',
version: '0.1.0',
meson_version: '>= 1.0.0',
meson_version: '>= 1.2.0',
default_options: [ 'warning_level=2', 'werror=false', ],
)
......
......@@ -2,7 +2,7 @@ pkgdatadir = get_option('prefix') / get_option('datadir') / meson.project_name()
moduledir = pkgdatadir / 'tuneit'
gnome = import('gnome')
blp_search = run_command('find_blp.sh', '')
blp_search = run_command('find_blp.sh', '', check: true)
blp_files = blp_search.stdout().splitlines()
......@@ -58,12 +58,12 @@ tuneit_sources = [
install_data(tuneit_sources, install_dir: moduledir)
blp_search_settings = run_command('find_blp.sh', 'settings')
blp_search_shop = run_command('find_blp.sh', 'shop')
blp_search_settings = run_command('find_blp.sh', 'settings', check: true)
blp_search_shop = run_command('find_blp.sh', 'shop', check: true)
blp_files_settings = blp_search_settings.stdout().splitlines()
blp_files_shop = blp_search_shop.stdout().splitlines()
install_subdir('settings', install_dir: moduledir, strip_directory : false, exclude_files: blp_files_settings)
install_subdir('shop', install_dir: moduledir, strip_directory : false, exclude_files: blp_files_shop)
# install_subdir('shop', install_dir: moduledir, strip_directory : false, exclude_files: blp_files_shop)
......@@ -257,11 +257,7 @@ class Page:
self.sections = sorted(self.sections, key=lambda s: s.weight)
def create_stack_page(self, stack, listbox):
box = Gtk.ScrolledWindow()
pref_page = Adw.PreferencesPage()
clamp = Adw.Clamp()
clamp.set_child(pref_page)
box.set_child(clamp)
not_empty = False
......@@ -274,14 +270,14 @@ class Page:
print(f"Секция {section.name} не создала виджетов.")
if not_empty:
stack_page = stack.add_child(box)
stack_page = stack.add_child(pref_page)
stack_page.set_title(self.name)
stack_page.set_name(self.name)
row = TuneItPanelRow()
row.set_name(self.name)
row.set_title(self.name)
row.icon_name = self.icon
row.props.name = self.name
row.props.title = self.name
row.props.icon_name = self.icon
listbox.append(row)
else:
print(f"the page {self.name} is empty, ignored")
......@@ -339,7 +335,7 @@ def init_settings_stack(stack, listbox, split_view):
def on_row_selected(listbox, row):
if row:
page_id = row.get_name()
page_id = row.props.name
print(f"Selected page: {page_id}")
visible_child = stack.get_child_by_name(page_id)
......
using Gtk 4.0;
using Adw 1;
template $TuneItPanelRow: Adw.PreferencesRow {
child: Box {
template $TuneItPanelRow: ListBoxRow {
Box {
spacing: 12;
margin-start: 6;
margin-end: 6;
margin-top: 12;
margin-bottom: 12;
margin-top: 6;
margin-bottom: 6;
margin-start: 2;
margin-end: 2;
Image thumbnail_image {
icon-name: bind template.icon-name;
......@@ -15,17 +14,28 @@ template $TuneItPanelRow: Adw.PreferencesRow {
Box {
orientation: vertical;
Label label {
valign: center;
spacing: 2;
Label title_label {
label: bind template.title;
halign: start;
justify: left;
wrap: true;
}
// Label sub_label {
// label: bind template.subtitle;
// styles [
// "caption"
// ]
// }
Label subtitle_label {
styles [
"caption",
"dim-label",
]
label: bind template.subtitle;
visible: bind template.subtitle-visible;
halign: start;
justify: left;
wrap: true;
}
}
};
}
}
......@@ -2,24 +2,12 @@ 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
class TuneItPanelRow(Gtk.ListBoxRow):
@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
__gtype_name__ = "TuneItPanelRow"
@subtitle.setter
def subtitle(self, subtitle):
self._subtitle = subtitle
name = GObject.Property(type=str, default='')
title = GObject.Property(type=str, default='')
subtitle = GObject.Property(type=str, default='')
subtitle_visible = GObject.Property(type=bool, default=False)
icon_name = GObject.Property(type=str, default='')
......@@ -2,22 +2,36 @@ using Gtk 4.0;
using Adw 1;
template $TuneitWindow: Adw.ApplicationWindow {
width-request: 360;
height-request: 294;
default-height: 600;
default-width: 800;
title: _("TuneIt");
Adw.Breakpoint {
condition ("max-width: 400sp")
condition ("max-width: 500sp")
setters {
header_bar.title-widget: null;
main_toolbar.top-bar-style: flat;
settinga_content_bar.visible: true;
switcher_bar.reveal: true;
header_view_switcher.visible: false;
main_toolbar.reveal-bottom-bars: true;
main_toolbar.reveal-top-bars: false;
settings_split_view.collapsed: true;
}
}
content: Adw.ToolbarView main_toolbar{
top-bar-style: raised_border;
content: Adw.ToolbarView main_toolbar {
top-bar-style: raised;
bottom-bar-style: raised;
reveal-bottom-bars: false;
[top]
Adw.HeaderBar header_bar {
[title]
Adw.ViewSwitcher header_view_switcher {
policy: wide;
stack: main_stack;
}
[end]
MenuButton {
icon-name: "open-menu-symbolic";
......@@ -25,71 +39,89 @@ template $TuneitWindow: Adw.ApplicationWindow {
primary: true;
tooltip-text: _("Main Menu");
}
[title]
Adw.ViewSwitcher {
policy: wide;
stack: main_stack;
}
}
Adw.ViewStack main_stack {
Adw.ViewStackPage {
child: Box {
Adw.NavigationSplitView settings_split_view {
hexpand: true;
content: Adw.NavigationPage {
Adw.ToolbarView {
[top]
Adw.HeaderBar settinga_content_bar {
decoration-layout: "";
visible: false;
icon-name: "preferences-system";
name: "settings";
title: _("Settings");
child: Adw.NavigationSplitView settings_split_view {
hexpand: true;
content: Adw.NavigationPage {
title: bind settings_pagestack.visible-child-name;
Adw.ToolbarView {
reveal-top-bars: bind main_toolbar.reveal-top-bars inverted;
[top]
Adw.HeaderBar header_bar2 {
[end]
MenuButton {
icon-name: "open-menu-symbolic";
menu-model: primary_menu;
primary: true;
tooltip-text: _("Main Menu");
}
}
Stack settings_pagestack {}
}
};
sidebar: Adw.NavigationPage {
title: _("Sections");
Adw.ToolbarView {
reveal-top-bars: bind main_toolbar.reveal-top-bars inverted;
Stack settings_pagestack {}
[top]
Adw.HeaderBar {
[end]
MenuButton {
icon-name: "open-menu-symbolic";
menu-model: primary_menu;
primary: true;
tooltip-text: _("Main Menu");
}
}
};
sidebar: Adw.NavigationPage {
Adw.ClampScrollable {
margin-bottom: 8;
margin-end: 8;
margin-start: 8;
margin-top: 8;
ListBox settings_listbox {
styles [
"navigation-sidebar",
]
ScrolledWindow {
propagate-natural-height: true;
hscrollbar-policy: never;
Adw.Clamp {
maximum-size: 500;
ListBox settings_listbox {
styles [
"navigation-sidebar",
]
}
}
}
};
}
}
};
};
icon-name: "preferences-system";
name: "settings";
title: _("Settings");
}
Adw.ViewStackPage {
child: Box {};
icon-name: "preferences-system";
name: "shop";
title: _("Shop");
child: Box {};
}
}
[bottom]
Adw.ViewSwitcherBar switcher_bar {
reveal: true;
stack: main_stack;
}
};
default-height: 600;
default-width: 800;
title: _("TuneIt");
}
menu primary_menu {
......@@ -110,4 +142,3 @@ menu primary_menu {
}
}
}
......@@ -53,4 +53,4 @@ class TuneitWindow(Adw.ApplicationWindow):
self.settings_pagestack,
self.settings_listbox,
self.settings_split_view,
)
\ No newline at end of file
)
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