diff options
Diffstat (limited to 'capplets')
-rw-r--r-- | capplets/display/display-capplet.ui | 258 | ||||
-rw-r--r-- | capplets/display/xrandr-capplet.c | 25 |
2 files changed, 181 insertions, 102 deletions
diff --git a/capplets/display/display-capplet.ui b/capplets/display/display-capplet.ui index fec38817..9887a410 100644 --- a/capplets/display/display-capplet.ui +++ b/capplets/display/display-capplet.ui @@ -1,19 +1,99 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <interface> <requires lib="gtk+" version="2.16"/> <!-- interface-naming-policy toplevel-contextual --> <object class="GtkDialog" id="dialog"> + <property name="can_focus">False</property> <property name="border_width">5</property> <property name="title" translatable="yes">Monitor Preferences</property> <property name="type_hint">dialog</property> <child internal-child="vbox"> <object class="GtkVBox" id="dialog-vbox1"> <property name="visible">True</property> - <property name="orientation">vertical</property> + <property name="can_focus">False</property> <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkHButtonBox" id="dialog-action_area1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="helpbutton1"> + <property name="label">gtk-help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + <property name="secondary">True</property> + </packing> + </child> + <child> + <object class="GtkButton" id="make_default_button"> + <property name="label" translatable="yes">Apply system-wide</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Applies the current configuration for other MATE users on the computer. Note that this doesn't affect login screens or other desktop environments.</property> + <property name="use_action_appearance">False</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="apply_button"> + <property name="label">gtk-apply</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="button2"> + <property name="label">gtk-close</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">3</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> <child> <object class="GtkTable" id="table2"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="n_rows">2</property> <property name="n_columns">2</property> <property name="column_spacing">12</property> @@ -21,22 +101,26 @@ <child> <object class="GtkVBox" id="vbox3"> <property name="visible">True</property> - <property name="orientation">vertical</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkAlignment" id="align"> <property name="visible">True</property> + <property name="can_focus">False</property> <child> <placeholder/> </child> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkHBox" id="hbox1"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkCheckButton" id="clone_checkbox"> @@ -44,6 +128,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="draw_indicator">True</property> </object> @@ -59,6 +144,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> </object> <packing> @@ -80,10 +166,11 @@ <child> <object class="GtkVBox" id="vbox4"> <property name="visible">True</property> - <property name="orientation">vertical</property> + <property name="can_focus">False</property> <child> <object class="GtkLabel" id="label8"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Panel icon</property> <attributes> @@ -99,6 +186,7 @@ <child> <object class="GtkAlignment" id="alignment2"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="left_padding">12</property> <child> <object class="GtkCheckButton" id="show_notification_icon"> @@ -106,6 +194,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="draw_indicator">True</property> </object> @@ -127,72 +216,79 @@ <child> <object class="GtkAlignment" id="alignment1"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="yalign">0</property> <child> <object class="GtkTable" id="table1"> <property name="visible">True</property> - <property name="n_rows">6</property> + <property name="can_focus">False</property> + <property name="n_rows">7</property> <property name="n_columns">2</property> <property name="column_spacing">12</property> <property name="row_spacing">6</property> <child> <object class="GtkLabel" id="label2"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">_Resolution:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">resolution_combo</property> </object> <packing> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> + <property name="y_options"/> </packing> </child> <child> <object class="GtkLabel" id="label3"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Re_fresh rate:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">refresh_combo</property> </object> <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> + <property name="y_options"/> </packing> </child> <child> <object class="GtkComboBox" id="resolution_combo"> <property name="visible">True</property> + <property name="can_focus">False</property> </object> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options"></property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="y_options"/> </packing> </child> <child> <object class="GtkComboBox" id="refresh_combo"> <property name="visible">True</property> + <property name="can_focus">False</property> </object> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="y_options"></property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="y_options"/> </packing> </child> <child> <object class="GtkHBox" id="hbox2"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkRadioButton" id="monitor_on_radio"> @@ -200,6 +296,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="active">True</property> <property name="draw_indicator">True</property> @@ -216,6 +313,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="draw_indicator">True</property> <property name="group">monitor_on_radio</property> @@ -231,15 +329,17 @@ <property name="right_attach">2</property> <property name="top_attach">1</property> <property name="bottom_attach">2</property> - <property name="y_options"></property> + <property name="y_options"/> </packing> </child> <child> <object class="GtkEventBox" id="current_monitor_event_box"> <property name="visible">True</property> + <property name="can_focus">False</property> <child> <object class="GtkLabel" id="current_monitor_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Monitor</property> <attributes> @@ -250,27 +350,29 @@ </object> <packing> <property name="right_attach">2</property> - <property name="y_options"></property> + <property name="y_options"/> </packing> </child> <child> <object class="GtkLabel" id="label5"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">R_otation:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">rotation_combo</property> </object> <packing> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> + <property name="y_options"/> </packing> </child> <child> <object class="GtkComboBox" id="rotation_combo"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="model">liststore1</property> <child> <object class="GtkCellRendererText" id="cellrenderertext1"/> @@ -282,9 +384,9 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="y_options"></property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + <property name="y_options"/> </packing> </child> <child> @@ -292,19 +394,22 @@ <property name="label" translatable="yes">Include _panel</property> <property name="can_focus">True</property> <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="draw_indicator">True</property> </object> <packing> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> + <property name="right_attach">2</property> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> + <property name="y_options"/> </packing> </child> <child> <object class="GtkAlignment" id="alignment4"> <property name="visible">True</property> + <property name="can_focus">False</property> <child> <placeholder/> </child> @@ -314,8 +419,26 @@ <property name="right_attach">2</property> <property name="top_attach">5</property> <property name="bottom_attach">6</property> - <property name="x_options"></property> - <property name="y_options"></property> + <property name="x_options"/> + <property name="y_options"/> + </packing> + </child> + <child> + <object class="GtkButton" id="primary_button"> + <property name="label" translatable="yes">Set as primary</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Sets the selected monitor as primary.</property> + <property name="use_action_appearance">False</property> + </object> + <packing> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> </packing> </child> </object> @@ -324,86 +447,17 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="x_options"></property> + <property name="x_options"/> <property name="y_options">GTK_FILL</property> </packing> </child> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="position">1</property> </packing> </child> - <child internal-child="action_area"> - <object class="GtkHButtonBox" id="dialog-action_area1"> - <property name="visible">True</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="helpbutton1"> - <property name="label">gtk-help</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - <property name="secondary">True</property> - </packing> - </child> - <child> - <object class="GtkButton" id="make_default_button"> - <property name="label" translatable="yes">Make Default</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkButton" id="apply_button"> - <property name="label">gtk-apply</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkButton" id="button2"> - <property name="label">gtk-close</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">3</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> </object> </child> <action-widgets> diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c index 6b09de84..bc91fd32 100644 --- a/capplets/display/xrandr-capplet.c +++ b/capplets/display/xrandr-capplet.c @@ -63,6 +63,7 @@ struct App GtkWidget *panel_checkbox; GtkWidget *clone_checkbox; GtkWidget *show_icon_checkbox; + GtkWidget *primary_button; /* We store the event timestamp when the Apply button is clicked */ GtkWidget *apply_button; @@ -690,6 +691,8 @@ rebuild_gui (App *app) #endif gtk_widget_set_sensitive (app->panel_checkbox, sensitive); + gtk_widget_set_sensitive (app->primary_button, app->current_output && !mate_rr_output_info_get_primary(app->current_output)); + app->ignore_gui_changes = FALSE; } @@ -2178,6 +2181,24 @@ on_detect_displays (GtkWidget *widget, gpointer data) } } +static void +set_primary (GtkWidget *widget, gpointer data) +{ + App *app = data; + int i; + MateRROutputInfo **outputs; + + if (!app->current_output) + return; + + outputs = mate_rr_config_get_outputs (app->current_configuration); + for (i=0; outputs[i]!=NULL; i++) { + mate_rr_output_info_set_primary (outputs[i], outputs[i] == app->current_output); + } + + gtk_widget_set_sensitive (app->primary_button, !mate_rr_output_info_get_primary(app->current_output)); +} + #define MSD_XRANDR_SCHEMA "org.mate.SettingsDaemon.plugins.xrandr" #define SHOW_ICON_KEY "show-notification-icon" #define DEFAULT_CONFIGURATION_FILE_KEY "default-configuration-file" @@ -2511,6 +2532,10 @@ run_application (App *app) g_signal_connect (_gtk_builder_get_widget (builder, "detect_displays_button"), "clicked", G_CALLBACK (on_detect_displays), app); + app->primary_button = _gtk_builder_get_widget (builder, "primary_button"); + + g_signal_connect (app->primary_button, "clicked", G_CALLBACK (set_primary), app); + app->show_icon_checkbox = _gtk_builder_get_widget (builder, "show_notification_icon"); |