Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tuneit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
tuneit
Commits
6ca987db
Commit
6ca987db
authored
Jan 23, 2025
by
Vladimir Vaskov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'master'
Impove UI See merge request
!2
parents
a39b8ab4
2f7d6d18
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
124 additions
and
100 deletions
+124
-100
meson.build
meson.build
+1
-1
meson.build
src/meson.build
+4
-4
main.py
src/settings/main.py
+5
-9
panel_row.blp
src/settings/widgets/panel_row.blp
+26
-16
panel_row.py
src/settings/widgets/panel_row.py
+7
-19
window.blp
src/window.blp
+80
-49
window.py
src/window.py
+1
-2
No files found.
meson.build
View file @
6ca987db
project('tuneit',
version: '0.1.0',
meson_version: '>= 1.
0
.0',
meson_version: '>= 1.
2
.0',
default_options: [ 'warning_level=2', 'werror=false', ],
)
...
...
src/meson.build
View file @
6ca987db
...
...
@@ -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)
src/settings/main.py
View file @
6ca987db
...
...
@@ -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
)
...
...
src/settings/widgets/panel_row.blp
View file @
6ca987db
using Gtk 4.0;
using Adw 1;
template $TuneItPanelRow:
Adw.Preferences
Row {
child:
Box {
template $TuneItPanelRow:
ListBox
Row {
Box {
spacing: 12;
margin-
start
: 6;
margin-
end
: 6;
margin-
top: 1
2;
margin-
bottom: 1
2;
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;
}
}
}
;
}
}
src/settings/widgets/panel_row.py
View file @
6ca987db
...
...
@@ -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
=
''
)
src/window.blp
View file @
6ca987db
...
...
@@ -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:
4
00sp")
condition ("max-width:
5
00sp")
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 {
}
}
}
src/window.py
View file @
6ca987db
...
...
@@ -53,4 +53,4 @@ class TuneitWindow(Adw.ApplicationWindow):
self
.
settings_pagestack
,
self
.
settings_listbox
,
self
.
settings_split_view
,
)
\ No newline at end of file
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment