Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tuner-displays
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
tuner-displays
Commits
5a064c3d
Verified
Commit
5a064c3d
authored
Jun 25, 2026
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ui: inline single monitor settings
parent
c409593f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
96 additions
and
42 deletions
+96
-42
displays-page.blp
data/ui/pages/displays-page.blp
+0
-0
monitor-settings-content.blp
data/ui/pages/monitor-settings-content.blp
+9
-1
meson.build
src/meson.build
+0
-1
plugin.vala
src/plugin.vala
+68
-2
displays-visibility.vala
src/ui/common/displays-visibility.vala
+4
-0
monitor-setting-validator.vala
src/ui/settings/monitor-setting-validator.vala
+13
-1
monitor-settings-preview-widget.vala
src/ui/widgets/monitor-settings-preview-widget.vala
+2
-0
single-monitor-widget.vala
src/ui/widgets/single-monitor-widget.vala
+0
-37
No files found.
data/ui/pages/displays-page.blp
View file @
5a064c3d
This diff is collapsed.
Click to expand it.
data/ui/pages/monitor-settings-content.blp
View file @
5a064c3d
...
...
@@ -10,7 +10,15 @@ Tuner.Page monitor_settings_content_page {
Tuner.Group {
id: "preview";
$TunerDisplaysMonitorSettingsPreviewWidget {}
$TunerDisplaysMonitorSettingsPreviewWidget {
binding: $TunerDisplaysMonitorSettingBinding {
field: "preview";
validator: $TunerDisplaysMonitorSettingValidator {
feature: "preview";
group-feature: "preview";
};
};
}
}
Tuner.Group {
...
...
src/meson.build
View file @
5a064c3d
...
...
@@ -29,7 +29,6 @@ sources = files(
'ui/widgets/monitor-settings-preview-widget.vala',
'ui/widgets/monitor-row.vala',
'ui/widgets/primary-display-widget.vala',
'ui/widgets/single-monitor-widget.vala',
'ui/widgets/status-widget.vala',
'ui/widgets/virtual-outputs-widget.vala',
'ui/pages/monitor-settings-content.vala',
...
...
src/plugin.vala
View file @
5a064c3d
...
...
@@ -5,6 +5,11 @@ namespace TunerDisplays {
private
Tuner
.
Page
monitor_page
;
private
Gtk
.
Box
monitor_page_content
;
private
Gtk
.
Label
monitor_page_title
;
private
MonitorSettingsContext
?
single_monitor_context
;
private
Adw
.
PreferencesGroup
?
single_display_group
;
private
Adw
.
PreferencesGroup
?
single_hyprland_group
;
private
Adw
.
PreferencesGroup
?
single_hdr_group
;
private
bool
single_monitor_groups_ready
;
construct
{
Intl
.
bindtextdomain
(
GETTEXT_PACKAGE
,
LOCALEDIR
);
...
...
@@ -12,6 +17,9 @@ namespace TunerDisplays {
load_css
();
DisplaysContext
.
controller
=
new
DisplaysController
();
DisplaysContext
.
controller
.
reload
();
create_main_monitor_context
();
DisplaysContext
.
controller
.
changed
.
connect
(
create_main_monitor_context
);
typeof
(
ConfigIncludeBinding
).
ensure
();
typeof
(
ConfigIncludeValidator
).
ensure
();
...
...
@@ -27,7 +35,6 @@ namespace TunerDisplays {
typeof
(
MirrorSettingsWidget
).
ensure
();
typeof
(
PrimaryDisplayWidget
).
ensure
();
typeof
(
MonitorListWidget
).
ensure
();
typeof
(
SingleMonitorWidget
).
ensure
();
typeof
(
VirtualOutputsWidget
).
ensure
();
typeof
(
MonitorSettingBinding
).
ensure
();
typeof
(
MonitorSettingValidator
).
ensure
();
...
...
@@ -72,7 +79,9 @@ namespace TunerDisplays {
DisplaysContext
.
controller
.
monitor_settings_requested
.
connect
(
show_monitor_settings
);
add_page
(
page
);
DisplaysContext
.
controller
.
reload
();
Idle
.
add
(()
=>
{
return
setup_single_monitor_groups
();
});
}
private
void
load_css
()
{
...
...
@@ -104,6 +113,63 @@ namespace TunerDisplays {
content
.
monitor_changed
.
connect
(
DisplaysContext
.
controller
.
refresh_from_monitors
);
return
content
;
}
private
void
create_main_monitor_context
()
{
var
controller
=
DisplaysContext
.
controller
;
var
monitor
=
controller
.
monitors
.
size
>
0
?
controller
.
monitors
[
0
]
:
new
MonitorConfig
();
single_monitor_context
=
new
MonitorSettingsContext
(
monitor
,
controller
.
backend
,
controller
.
monitors
,
false
);
MonitorSettingsState
.
current
=
single_monitor_context
;
single_monitor_context
.
changed
.
connect
(
controller
.
refresh_from_monitors
);
}
private
bool
setup_single_monitor_groups
()
{
if
(
single_monitor_groups_ready
)
return
false
;
var
panel_page
=
page
.
list
as
Tuner
.
PanelPage
;
if
(
panel_page
==
null
)
return
true
;
var
content
=
panel_page
.
content
;
if
(
content
==
null
)
return
true
;
var
panel_content
=
content
as
Tuner
.
PanelContent
;
if
(
panel_content
==
null
)
return
true
;
find_single_monitor_groups
(
panel_content
);
single_monitor_groups_ready
=
true
;
update_single_monitor_groups
();
DisplaysContext
.
controller
.
changed
.
connect
(
update_single_monitor_groups
);
return
false
;
}
private
void
find_single_monitor_groups
(
Tuner
.
PanelContent
content
)
{
for
(
var
child
=
content
.
get_groups_container
().
get_first_child
();
child
!=
null
;
child
=
child
.
get_next_sibling
())
{
var
group
=
child
as
Adw
.
PreferencesGroup
;
if
(
group
==
null
)
continue
;
if
(
group
.
title
==
_
(
"Display"
))
single_display_group
=
group
;
else
if
(
group
.
title
==
_
(
"Hyprland"
))
single_hyprland_group
=
group
;
else
if
(
group
.
title
==
_
(
"HDR / EDID overrides"
))
single_hdr_group
=
group
;
}
}
private
void
update_single_monitor_groups
()
{
var
visible
=
DisplaysContext
.
controller
.
single_monitor_mode
();
if
(
single_display_group
!=
null
)
single_display_group
.
visible
=
visible
;
if
(
single_hyprland_group
!=
null
)
single_hyprland_group
.
visible
=
visible
&&
monitor_feature_visible
(
"hyprland"
);
if
(
single_hdr_group
!=
null
)
single_hdr_group
.
visible
=
visible
&&
monitor_feature_visible
(
"hdr"
);
}
}
}
...
...
src/ui/common/displays-visibility.vala
View file @
5a064c3d
...
...
@@ -41,6 +41,10 @@ namespace TunerDisplays {
public
override
void
apply
(
Tuner
.
Binding
binding
,
Gtk
.
Widget
native_widget
)
{
update
(
binding
,
native_widget
);
Idle
.
add
(()
=>
{
update
(
binding
,
native_widget
);
return
false
;
});
DisplaysContext
.
controller
.
changed
.
connect
(()
=>
update
(
binding
,
native_widget
));
}
...
...
src/ui/settings/monitor-setting-validator.vala
View file @
5a064c3d
...
...
@@ -6,7 +6,12 @@ namespace TunerDisplays {
public
override
void
apply
(
Tuner
.
Binding
binding
,
Gtk
.
Widget
native_widget
)
{
update
(
native_widget
);
Idle
.
add
(()
=>
{
update
(
native_widget
);
return
false
;
});
MonitorSettingsState
.
current
.
changed
.
connect
(()
=>
update
(
native_widget
));
DisplaysContext
.
controller
.
changed
.
connect
(()
=>
update
(
native_widget
));
}
private
void
update
(
Gtk
.
Widget
widget
)
{
...
...
@@ -22,13 +27,20 @@ namespace TunerDisplays {
var
context
=
MonitorSettingsState
.
current
;
var
backend
=
context
.
backend
;
var
monitor
=
context
.
monitor
;
switch
(
feature
)
{
case
""
:
case
"always"
:
return
true
;
case
"enabled"
:
return
context
.
show_enabled
;
case
"preview"
:
return
context
.
all_monitors
.
size
>
1
;
case
"single-monitor-display"
:
return
DisplaysContext
.
controller
.
single_monitor_mode
();
case
"single-monitor-hyprland"
:
return
DisplaysContext
.
controller
.
single_monitor_mode
()
&&
monitor_feature_visible
(
"hyprland"
);
case
"single-monitor-hdr"
:
return
DisplaysContext
.
controller
.
single_monitor_mode
()
&&
monitor_feature_visible
(
"hdr"
);
case
"combined-mode"
:
return
!
backend
.
uses_separate_refresh_rate_controls
;
case
"separate-refresh"
:
...
...
src/ui/widgets/monitor-settings-preview-widget.vala
View file @
5a064c3d
...
...
@@ -25,6 +25,8 @@ namespace TunerDisplays {
context
.
changed
.
connect
(()
=>
layout
.
set_monitors
(
context
.
all_monitors
));
row
.
child
=
layout
;
if
(
binding
!=
null
&&
binding
.
validator
!=
null
)
binding
.
validator
.
apply
(
binding
,
row
);
return
row
;
}
}
...
...
src/ui/widgets/single-monitor-widget.vala
deleted
100644 → 0
View file @
c409593f
namespace
TunerDisplays
{
public
class
SingleMonitorWidget
:
Tuner
.
Widget
{
private
Gtk
.
Box
box
;
private
MonitorSettingsContent
?
content
;
public
override
Gtk
.
Widget
?
create
()
{
box
=
new
Gtk
.
Box
(
Gtk
.
Orientation
.
VERTICAL
,
0
);
DisplaysContext
.
controller
.
changed
.
connect
(
rebuild
);
rebuild
();
if
(
binding
!=
null
&&
binding
.
validator
!=
null
)
binding
.
validator
.
apply
(
binding
,
box
);
return
box
;
}
private
void
rebuild
()
{
var
child
=
box
.
get_first_child
();
while
(
child
!=
null
)
{
var
next
=
child
.
get_next_sibling
();
box
.
remove
(
child
);
child
=
next
;
}
content
=
null
;
var
controller
=
DisplaysContext
.
controller
;
if
(!
controller
.
single_monitor_mode
())
{
box
.
visible
=
false
;
return
;
}
content
=
new
MonitorSettingsContent
(
controller
.
monitors
[
0
],
controller
.
backend
,
controller
.
monitors
,
false
);
content
.
monitor_changed
.
connect
(
controller
.
refresh_from_monitors
);
box
.
append
(
content
);
box
.
visible
=
true
;
}
}
}
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