gnome-control-center/panels/display/cc-display-panel.ui
Jonas Ådahl 21862c3e48 display: Only display configuration options if apply is allowed
org.gnome.Mutter.DisplayConfig contains a new property that tells
whether apply will be allowed to be called or not. Whether it is true or
not depends on policy stored in any of its monitors.xml configuration
files.

In order to make it clearer that configuration is not possible, except
for night light, make sure to hide the unconfigurable parts, leaving
only night light.
2022-01-25 16:43:26 +00:00

307 lines
14 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="CcDisplayPanel" parent="CcPanel">
<child>
<object class="GtkShortcutController" id="toplevel_shortcuts">
<property name="scope">global</property>
<property name="name">Display Panel Globals Shortcuts</property>
<child>
<object class="GtkShortcut" id="escape_shortcut">
<property name="trigger">Escape</property>
<property name="action">callback(on_toplevel_escape_pressed_cb)</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkOverlay">
<child type="overlay">
<object class="AdwHeaderBar" id="apply_titlebar">
<property name="visible">False</property>
<property name="valign">start</property>
<property name="show-start-title-buttons">False</property>
<property name="show-end-title-buttons">False</property>
<child type="start">
<object class="GtkButton" id="cancel_button">
<property name="use-underline">True</property>
<property name="label" translatable="yes">_Cancel</property>
<signal name="clicked" handler="on_screen_changed" object="CcDisplayPanel" swapped="yes" />
</object>
</child>
<property name="title-widget">
<object class="AdwWindowTitle" id="apply_titlebar_title_widget" />
</property>
<child type="end">
<object class="GtkButton" id="apply_button">
<property name="use-underline">True</property>
<property name="label" translatable="yes">_Apply</property>
<signal name="clicked" handler="apply_current_configuration" object="CcDisplayPanel" swapped="yes" />
<style>
<class name="suggested-action" />
</style>
</object>
</child>
</object>
</child>
<child>
<object class="AdwLeaflet" id="leaflet">
<property name="can-unfold">False</property>
<!-- Displays page -->
<child>
<object class="AdwLeafletPage">
<property name="name">displays</property>
<property name="child">
<object class="GtkBox">
<property name="orientation">vertical</property>
<!-- Displays page titlebar -->
<child>
<object class="AdwHeaderBar" id="displays_titlebar">
<property name="show-end-title-buttons">True</property>
<property name="show-start-title-buttons" bind-source="CcDisplayPanel" bind-property="folded" bind-flags="default|sync-create" />
<child type="start">
<object class="GtkButton">
<property name="visible" bind-source="CcDisplayPanel" bind-property="folded" bind-flags="default|sync-create" />
<property name="icon-name">go-previous-symbolic</property>
<property name="action-name">window.navigate</property>
<property name="action-target">0</property> <!-- 0: ADW_NAVIGATION_DIRECTION_BACK -->
</object>
</child>
<property name="title-widget">
<object class="AdwWindowTitle">
<property name="title" bind-source="CcDisplayPanel" bind-property="title" bind-flags="default|sync-create" />
</object>
</property>
</object>
</child>
<child>
<object class="AdwPreferencesPage">
<child>
<object class="AdwPreferencesGroup" id="display_settings_disabled_group">
<property name="visible">False</property>
<child>
<object class="AdwStatusPage">
<property name="vexpand">True</property>
<property name="icon-name">computer-symbolic</property>
<property name="title" translatable="yes">Display Settings Disabled</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup" id="arrangement_group">
<child>
<object class="AdwBin" id="arrangement_bin">
<style>
<class name="card"/>
</style>
</object>
</child>
<accessibility>
<property name="label" translatable="yes">Display Arrangement</property>
</accessibility>
</object>
</child>
<child>
<object class="AdwPreferencesGroup" id="display_settings_group">
<!-- Config Type -->
<child>
<object class="AdwActionRow" id="config_type_switcher_row">
<property name="title" translatable="yes">Multiple Displays</property>
<child type="suffix">
<object class="GtkBox">
<property name="valign">center</property>
<style>
<class name="linked" />
</style>
<child>
<object class="GtkToggleButton" id="config_type_join">
<property name="label" translatable="yes" comments="'Join' as in 'Join displays'">Join</property>
<property name="active">True</property>
<signal name="toggled" handler="on_config_type_toggled_cb" swapped="yes"/>
</object>
</child>
<child>
<object class="GtkToggleButton" id="config_type_mirror">
<property name="label" translatable="yes">Mirror</property>
<property name="group">config_type_join</property>
<signal name="toggled" handler="on_config_type_toggled_cb" swapped="yes"/>
</object>
</child>
</object>
</child>
</object>
</child>
<!-- Primary Display -->
<child>
<object class="AdwComboRow" id="primary_display_row">
<property name="subtitle" translatable="yes">Contains top bar and Activities</property>
<property name="title" translatable="yes">Primary Display</property>
<signal name="notify::selected-index" handler="on_primary_display_selected_index_changed_cb" swapped="yes"/>
</object>
</child>
</object>
</child>
<!-- Single Display Settings -->
<child>
<object class="AdwPreferencesGroup" id="single_display_settings_group">
<property name="visible">False</property>
</object>
</child>
<!-- Night Light -->
<child>
<object class="AdwPreferencesGroup">
<child>
<object class="AdwActionRow">
<property name="activatable">True</property>
<property name="title" translatable="yes" comments="This is the redshift functionality where we suppress blue light when the sun has gone down">Night Light</property>
<signal name="activated" handler="on_night_light_row_activated_cb" object="CcDisplayPanel" swapped="no" />
<child type="suffix">
<object class="GtkLabel" id="night_light_state_label">
<property name="label">On</property>
</object>
</child>
<child type="suffix">
<object class="GtkImage">
<property name="icon-name">go-next-symbolic</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</child>
<!-- Night Light page -->
<child>
<object class="AdwLeafletPage">
<property name="name">night-light</property>
<property name="child">
<object class="GtkBox">
<property name="orientation">vertical</property>
<!-- Night Light titlebar -->
<child>
<object class="AdwHeaderBar" id="night_light_titlebar">
<property name="show-start-title-buttons">True</property>
<property name="show-end-title-buttons">True</property>
<child type="start">
<object class="GtkButton">
<property name="icon-name">go-previous-symbolic</property>
<signal name="clicked" handler="on_back_button_clicked_cb" object="CcDisplayPanel" swapped="no" />
</object>
</child>
<property name="title-widget">
<object class="AdwWindowTitle">
<property name="title" translatable="yes">Night Light</property>
</object>
</property>
</object>
</child>
<!-- Night Light -->
<child>
<object class="CcNightLightPage" id="night_light_page" />
</child>
</object>
</property>
</object>
</child>
<!-- Display Settings page -->
<child>
<object class="AdwLeafletPage">
<property name="name">display-settings</property>
<property name="child"><object class="GtkBox">
<property name="orientation">vertical</property>
<!-- Display Settings titlebar -->
<child>
<object class="AdwHeaderBar" id="display_settings_titlebar">
<property name="show-start-title-buttons">True</property>
<property name="show-end-title-buttons">True</property>
<child type="start">
<object class="GtkButton">
<property name="icon-name">go-previous-symbolic</property>
<signal name="clicked" handler="on_back_button_clicked_cb" object="CcDisplayPanel" swapped="no" />
</object>
</child>
<property name="title-widget">
<object class="AdwWindowTitle" id="display_settings_title_widget" />
</property>
</object>
</child>
<!-- Display Settings -->
<child>
<object class="AdwPreferencesPage">
<child>
<object class="AdwPreferencesGroup">
<child>
<object class="AdwBin" id="display_settings_bin" />
</child>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
<object class="GtkSizeGroup">
<property name="mode">horizontal</property>
<widgets>
<widget name="apply_button" />
<widget name="cancel_button" />
</widgets>
</object>
<object class="GtkSizeGroup">
<property name="mode">vertical</property>
<widgets>
<widget name="apply_titlebar" />
<widget name="displays_titlebar" />
<widget name="display_settings_titlebar" />
<widget name="night_light_titlebar" />
</widgets>
</object>
</interface>