Merge lp:~3v1n0/unity-control-center/unity-lowgfx-support into lp:unity-control-center

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Sebastien Bacher
Approved revision: no longer in the source branch.
Merged at revision: 12887
Proposed branch: lp:~3v1n0/unity-control-center/unity-lowgfx-support
Merge into: lp:unity-control-center
Prerequisite: lp:~3v1n0/unity-control-center/grouped-compiz-gsettings-support
Diff against target: 724 lines (+362/-170)
2 files modified
panels/appearance/appearance.ui (+285/-170)
panels/appearance/cc-appearance-panel.c (+77/-0)
To merge this branch: bzr merge lp:~3v1n0/unity-control-center/unity-lowgfx-support
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Matthew Paul Thomas (community) design Approve
Unity Control Center development team Pending
Review via email: mp+326311@code.launchpad.net

This proposal supersedes a proposal from 2017-04-04.

Commit message

appearance: support multiple compiz setting profiles, and update lowgfx key accordingly

We only control the value of the "lowgfx" key here, and monitor changes.
The actual change of the profile is up to the unity components.

We monitor the current used profile by looking at org.compiz settings.

I've created a small utility class, GroupedGSettings, that allows to easily
manage multiple settings that share the same schema, but that have different paths.
It allows to set a default path and get value changes from that, while setting
parameters for every value.

So now, when you change any compiz parameter, it will apply to both 'unity' and
'unity-lowgfx' profiles. While we'll just monitor the current one for changes.

Description of the change

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote : Posted in a previous version of this proposal

Looks good, did we get input from design on the layout though?

review: Approve
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote : Posted in a previous version of this proposal

Nope... As I just fixed the work that was done previously in UI side, so not sure there was some interaction in that side.

Anyway,let me split this in the two parts though, so in case we can just backport the non-UI side.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote : Posted in a previous version of this proposal

For design, this is the look so far... http://i.imgur.com/A0LqSBe.png

Revision history for this message
Matthew Paul Thomas (mpt) wrote : Posted in a previous version of this proposal

There are many language and layout problems here, but some of them are not new. Unfortunately the diff is too long for me to tell exactly which ones. Please provide a Before screenshot to compare with the After screenshot. Thanks!

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote : Posted in a previous version of this proposal
Revision history for this message
Matthew Paul Thomas (mpt) wrote : Posted in a previous version of this proposal

Thanks.

Unfortunately I can’t tell what “Appearance and other effects” refers to.

Last year another option was introduced in exactly the same place, labelled “Low graphics mode”. <http://www.omgubuntu.co.uk/2017/04/unity-low-gfx-mode-toggle> That was also a mysterious name, but I was told we had to use it because users were already familiar with it.

Is this the same option? What happened to the previous implementation?

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote : Posted in a previous version of this proposal

It's the same option, but that option actually never landed because of other non-UI problems with that implementation.

I'm feel to change the wording to what you prefer, though.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

I've rebased this branch on top of lp:~3v1n0/unity-control-center/grouped-compiz-gsettings-support so that this has only the UI bits.

Revision history for this message
Matthew Paul Thomas (mpt) wrote :

Thanks for the explanation.

Assuming that we can’t tidy up the rest of this panel, I suggest adding the new setting with this layout and text: https://launchpadlibrarian.net/325752274/visual-effects.png

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

Layout approved based on <https://usercontent.irccloud-cdn.com/file/25Vufs1J/>. Thanks Marco.

review: Approve (design)
Revision history for this message
Sebastien Bacher (seb128) wrote :

code looks good

review: Approve
12909. By Marco Trevisan (Treviño)

appearance.ui: redesign the look of the visual effects section

mpt gave a good input on this.

12910. By Marco Trevisan (Treviño)

appearance: ensure we also hide the related separators when needed

12911. By Marco Trevisan (Treviño)

appearance: hide lowgfx parameters if gsetting or profiles aren't there

12912. By Marco Trevisan (Treviño)

appearance: remove unneeded nested boxes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'panels/appearance/appearance.ui'
--- panels/appearance/appearance.ui 2016-01-28 16:15:49 +0000
+++ panels/appearance/appearance.ui 2017-06-27 23:35:33 +0000
@@ -1,7 +1,10 @@
1<?xml version="1.0" encoding="UTF-8"?>1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Generated with glade 3.16.1 -->2<!-- Generated with glade 3.20.0 -->
3<interface>3<interface>
4 <requires lib="gtk+" version="3.0"/>4 <requires lib="gtk+" version="3.0"/>
5 <object class="GtkSizeGroup" id="sizegroup">
6 <property name="mode">vertical</property>
7 </object>
5 <object class="GtkListStore" id="sources-liststore">8 <object class="GtkListStore" id="sources-liststore">
6 <columns>9 <columns>
7 <!-- column-name source-name -->10 <!-- column-name source-name -->
@@ -84,9 +87,9 @@
84 <object class="GtkLabel" id="label1">87 <object class="GtkLabel" id="label1">
85 <property name="visible">True</property>88 <property name="visible">True</property>
86 <property name="can_focus">False</property>89 <property name="can_focus">False</property>
87 <property name="xalign">0</property>
88 <property name="label" translatable="yes">&lt;b&gt;Background&lt;/b&gt;</property>90 <property name="label" translatable="yes">&lt;b&gt;Background&lt;/b&gt;</property>
89 <property name="use_markup">True</property>91 <property name="use_markup">True</property>
92 <property name="xalign">0</property>
90 </object>93 </object>
91 <packing>94 <packing>
92 <property name="expand">False</property>95 <property name="expand">False</property>
@@ -190,8 +193,8 @@
190 <object class="GtkLabel" id="slide-label">193 <object class="GtkLabel" id="slide-label">
191 <property name="visible">True</property>194 <property name="visible">True</property>
192 <property name="can_focus">False</property>195 <property name="can_focus">False</property>
193 <property name="xalign">0</property>
194 <property name="label" translatable="yes" comments="This refers to a slideshow background">Changes throughout the day</property>196 <property name="label" translatable="yes" comments="This refers to a slideshow background">Changes throughout the day</property>
197 <property name="xalign">0</property>
195 </object>198 </object>
196 <packing>199 <packing>
197 <property name="expand">False</property>200 <property name="expand">False</property>
@@ -454,10 +457,10 @@
454 <object class="GtkLabel" id="theme-label">457 <object class="GtkLabel" id="theme-label">
455 <property name="visible">True</property>458 <property name="visible">True</property>
456 <property name="can_focus">False</property>459 <property name="can_focus">False</property>
457 <property name="xalign">0</property>
458 <property name="xpad">6</property>460 <property name="xpad">6</property>
459 <property name="label" translatable="yes">&lt;b&gt;Theme&lt;/b&gt;</property>461 <property name="label" translatable="yes">&lt;b&gt;Theme&lt;/b&gt;</property>
460 <property name="use_markup">True</property>462 <property name="use_markup">True</property>
463 <property name="xalign">0</property>
461 <accessibility>464 <accessibility>
462 <relation type="label-for" target="theme-selector"/>465 <relation type="label-for" target="theme-selector"/>
463 </accessibility>466 </accessibility>
@@ -521,10 +524,10 @@
521 <object class="GtkLabel" id="unity-iconsize-label">524 <object class="GtkLabel" id="unity-iconsize-label">
522 <property name="visible">True</property>525 <property name="visible">True</property>
523 <property name="can_focus">False</property>526 <property name="can_focus">False</property>
524 <property name="xalign">0</property>
525 <property name="xpad">6</property>527 <property name="xpad">6</property>
526 <property name="label" translatable="yes">&lt;b&gt;Launcher icon size&lt;/b&gt;</property>528 <property name="label" translatable="yes">&lt;b&gt;Launcher icon size&lt;/b&gt;</property>
527 <property name="use_markup">True</property>529 <property name="use_markup">True</property>
530 <property name="xalign">0</property>
528 <accessibility>531 <accessibility>
529 <relation type="label-for" target="unity-iconsize-scale"/>532 <relation type="label-for" target="unity-iconsize-scale"/>
530 </accessibility>533 </accessibility>
@@ -602,9 +605,9 @@
602 <object class="GtkLabel" id="label4">605 <object class="GtkLabel" id="label4">
603 <property name="visible">True</property>606 <property name="visible">True</property>
604 <property name="can_focus">False</property>607 <property name="can_focus">False</property>
605 <property name="xalign">0</property>
606 <property name="label" translatable="yes">&lt;b&gt;Auto-hide the Launcher&lt;/b&gt;</property>608 <property name="label" translatable="yes">&lt;b&gt;Auto-hide the Launcher&lt;/b&gt;</property>
607 <property name="use_markup">True</property>609 <property name="use_markup">True</property>
610 <property name="xalign">0</property>
608 <accessibility>611 <accessibility>
609 <relation type="label-for" target="unity_launcher_autohide"/>612 <relation type="label-for" target="unity_launcher_autohide"/>
610 </accessibility>613 </accessibility>
@@ -619,9 +622,9 @@
619 <object class="GtkLabel" id="label2">622 <object class="GtkLabel" id="label2">
620 <property name="visible">True</property>623 <property name="visible">True</property>
621 <property name="can_focus">False</property>624 <property name="can_focus">False</property>
622 <property name="xalign">0</property>
623 <property name="label" translatable="yes">&lt;span size="small"&gt;The launcher will reveal when moving the pointer to the defined hot spot.&lt;/span&gt;</property>625 <property name="label" translatable="yes">&lt;span size="small"&gt;The launcher will reveal when moving the pointer to the defined hot spot.&lt;/span&gt;</property>
624 <property name="use_markup">True</property>626 <property name="use_markup">True</property>
627 <property name="xalign">0</property>
625 </object>628 </object>
626 <packing>629 <packing>
627 <property name="expand">False</property>630 <property name="expand">False</property>
@@ -640,8 +643,8 @@
640 <object class="GtkLabel" id="unity_reveal_label">643 <object class="GtkLabel" id="unity_reveal_label">
641 <property name="visible">True</property>644 <property name="visible">True</property>
642 <property name="can_focus">False</property>645 <property name="can_focus">False</property>
643 <property name="xalign">0</property>
644 <property name="label" translatable="yes">Reveal location:</property>646 <property name="label" translatable="yes">Reveal location:</property>
647 <property name="xalign">0</property>
645 <accessibility>648 <accessibility>
646 <relation type="label-for" target="unity_reveal_spot_left"/>649 <relation type="label-for" target="unity_reveal_spot_left"/>
647 <relation type="label-for" target="unity_reveal_spot_topleft"/>650 <relation type="label-for" target="unity_reveal_spot_topleft"/>
@@ -826,20 +829,6 @@
826 <property name="position">0</property>829 <property name="position">0</property>
827 </packing>830 </packing>
828 </child>831 </child>
829 <child>
830 <object class="GtkLabel" id="unity-label-external-tool">
831 <property name="can_focus">False</property>
832 <property name="xalign">0</property>
833 <property name="xpad">12</property>
834 <property name="label" translatable="yes">Some settings have been overriden by an external program, press "Restore Default Behaviors" to reset the behavior and return control to this panel.</property>
835 <property name="wrap">True</property>
836 </object>
837 <packing>
838 <property name="expand">False</property>
839 <property name="fill">True</property>
840 <property name="position">1</property>
841 </packing>
842 </child>
843 </object>832 </object>
844 <packing>833 <packing>
845 <property name="expand">False</property>834 <property name="expand">False</property>
@@ -919,30 +908,200 @@
919 <object class="GtkBox" id="unity_menus_box">908 <object class="GtkBox" id="unity_menus_box">
920 <property name="visible">True</property>909 <property name="visible">True</property>
921 <property name="can_focus">False</property>910 <property name="can_focus">False</property>
911 <property name="margin_left">10</property>
912 <property name="margin_right">10</property>
913 <property name="homogeneous">True</property>
914 <child>
915 <object class="GtkBox" id="unity_menus_location_box">
916 <property name="visible">True</property>
917 <property name="can_focus">False</property>
918 <property name="orientation">vertical</property>
919 <child>
920 <object class="GtkLabel" id="label3">
921 <property name="visible">True</property>
922 <property name="can_focus">False</property>
923 <property name="label" translatable="yes">&lt;b&gt;Show the menus for a window&lt;/b&gt;</property>
924 <property name="use_markup">True</property>
925 <property name="xalign">0</property>
926 <accessibility>
927 <relation type="label-for" target="unity_global_menus"/>
928 <relation type="label-for" target="unity_local_menus"/>
929 </accessibility>
930 </object>
931 <packing>
932 <property name="expand">False</property>
933 <property name="fill">True</property>
934 <property name="position">0</property>
935 </packing>
936 </child>
937 <child>
938 <object class="GtkBox" id="unity_menus_type_box">
939 <property name="visible">True</property>
940 <property name="can_focus">False</property>
941 <property name="margin_top">9</property>
942 <property name="orientation">vertical</property>
943 <child>
944 <object class="GtkRadioButton" id="unity_global_menus">
945 <property name="label" translatable="yes">In the menu bar</property>
946 <property name="visible">True</property>
947 <property name="can_focus">True</property>
948 <property name="receives_default">False</property>
949 <property name="xalign">0</property>
950 <property name="draw_indicator">True</property>
951 <property name="group">unity_local_menus</property>
952 </object>
953 <packing>
954 <property name="expand">False</property>
955 <property name="fill">True</property>
956 <property name="position">1</property>
957 </packing>
958 </child>
959 <child>
960 <object class="GtkRadioButton" id="unity_local_menus">
961 <property name="label" translatable="yes">In the window's title bar</property>
962 <property name="visible">True</property>
963 <property name="can_focus">True</property>
964 <property name="receives_default">False</property>
965 <property name="xalign">0</property>
966 <property name="draw_indicator">True</property>
967 <property name="group">unity_global_menus</property>
968 </object>
969 <packing>
970 <property name="expand">False</property>
971 <property name="fill">True</property>
972 <property name="position">2</property>
973 </packing>
974 </child>
975 </object>
976 <packing>
977 <property name="expand">False</property>
978 <property name="fill">True</property>
979 <property name="position">1</property>
980 </packing>
981 </child>
982 </object>
983 <packing>
984 <property name="expand">False</property>
985 <property name="fill">True</property>
986 <property name="position">0</property>
987 </packing>
988 </child>
989 <child>
990 <object class="GtkBox" id="unity_menus_visibility_box">
991 <property name="visible">True</property>
992 <property name="can_focus">False</property>
993 <property name="orientation">vertical</property>
994 <child>
995 <object class="GtkLabel" id="label5">
996 <property name="visible">True</property>
997 <property name="can_focus">False</property>
998 <property name="label" translatable="yes">&lt;b&gt;Menus visibility&lt;/b&gt;</property>
999 <property name="use_markup">True</property>
1000 <property name="xalign">0</property>
1001 <accessibility>
1002 <relation type="label-for" target="unity_auto_hide_menus"/>
1003 <relation type="label-for" target="unity_always_show_menus"/>
1004 </accessibility>
1005 </object>
1006 <packing>
1007 <property name="expand">False</property>
1008 <property name="fill">True</property>
1009 <property name="position">0</property>
1010 </packing>
1011 </child>
1012 <child>
1013 <object class="GtkBox" id="unity_menus_visibility_type_box">
1014 <property name="visible">True</property>
1015 <property name="can_focus">False</property>
1016 <property name="margin_top">9</property>
1017 <property name="orientation">vertical</property>
1018 <child>
1019 <object class="GtkRadioButton" id="unity_auto_hide_menus">
1020 <property name="label" translatable="yes">Displayed on mouse hovering</property>
1021 <property name="visible">True</property>
1022 <property name="can_focus">True</property>
1023 <property name="receives_default">False</property>
1024 <property name="xalign">0</property>
1025 <property name="draw_indicator">True</property>
1026 <property name="group">unity_always_show_menus</property>
1027 </object>
1028 <packing>
1029 <property name="expand">False</property>
1030 <property name="fill">True</property>
1031 <property name="position">1</property>
1032 </packing>
1033 </child>
1034 <child>
1035 <object class="GtkRadioButton" id="unity_always_show_menus">
1036 <property name="label" translatable="yes">Always displayed</property>
1037 <property name="visible">True</property>
1038 <property name="can_focus">True</property>
1039 <property name="receives_default">False</property>
1040 <property name="xalign">0</property>
1041 <property name="draw_indicator">True</property>
1042 <property name="group">unity_auto_hide_menus</property>
1043 </object>
1044 <packing>
1045 <property name="expand">False</property>
1046 <property name="fill">True</property>
1047 <property name="position">2</property>
1048 </packing>
1049 </child>
1050 </object>
1051 <packing>
1052 <property name="expand">False</property>
1053 <property name="fill">True</property>
1054 <property name="position">1</property>
1055 </packing>
1056 </child>
1057 </object>
1058 <packing>
1059 <property name="expand">False</property>
1060 <property name="fill">True</property>
1061 <property name="position">1</property>
1062 </packing>
1063 </child>
1064 </object>
1065 <packing>
1066 <property name="expand">False</property>
1067 <property name="fill">True</property>
1068 <property name="padding">5</property>
1069 <property name="position">4</property>
1070 </packing>
1071 </child>
1072 <child>
1073 <object class="GtkSeparator" id="unity_menus_separator">
1074 <property name="visible">True</property>
1075 <property name="can_focus">False</property>
1076 </object>
1077 <packing>
1078 <property name="expand">False</property>
1079 <property name="fill">True</property>
1080 <property name="position">5</property>
1081 </packing>
1082 </child>
1083 <child>
1084 <object class="GtkBox" id="unity_gfx_mode_box">
1085 <property name="visible">True</property>
1086 <property name="can_focus">False</property>
922 <property name="orientation">vertical</property>1087 <property name="orientation">vertical</property>
923 <child>1088 <child>
924 <object class="GtkBox" id="box8">1089 <object class="GtkBox" id="unity_gfx_mode_selector_box">
925 <property name="visible">True</property>1090 <property name="visible">True</property>
926 <property name="can_focus">False</property>1091 <property name="can_focus">False</property>
927 <property name="margin_left">10</property>1092 <property name="margin_left">10</property>
928 <property name="margin_right">10</property>1093 <property name="margin_right">10</property>
929 <property name="homogeneous">True</property>1094 <property name="spacing">5</property>
930 <child>1095 <child>
931 <object class="GtkBox" id="unity_menus_location_box">1096 <object class="GtkBox">
932 <property name="visible">True</property>1097 <property name="visible">True</property>
933 <property name="can_focus">False</property>1098 <property name="can_focus">False</property>
934 <property name="orientation">vertical</property>1099 <property name="orientation">vertical</property>
935 <child>1100 <child>
936 <object class="GtkLabel" id="label3">1101 <object class="GtkLabel" id="label_gfx_mode">
937 <property name="visible">True</property>1102 <property name="visible">True</property>
938 <property name="can_focus">False</property>1103 <property name="can_focus">False</property>
939 <property name="xalign">0</property>1104 <property name="label" translatable="yes">Visual effects:</property>
940 <property name="label" translatable="yes">&lt;b&gt;Show the menus for a window&lt;/b&gt;</property>
941 <property name="use_markup">True</property>
942 <accessibility>
943 <relation type="label-for" target="unity_global_menus"/>
944 <relation type="label-for" target="unity_local_menus"/>
945 </accessibility>
946 </object>1105 </object>
947 <packing>1106 <packing>
948 <property name="expand">False</property>1107 <property name="expand">False</property>
@@ -951,50 +1110,7 @@
951 </packing>1110 </packing>
952 </child>1111 </child>
953 <child>1112 <child>
954 <object class="GtkBox" id="unity_menus_type_box">1113 <placeholder/>
955 <property name="visible">True</property>
956 <property name="can_focus">False</property>
957 <property name="margin_left">10</property>
958 <property name="margin_top">9</property>
959 <property name="orientation">vertical</property>
960 <child>
961 <object class="GtkRadioButton" id="unity_global_menus">
962 <property name="label" translatable="yes">In the menu bar</property>
963 <property name="visible">True</property>
964 <property name="can_focus">True</property>
965 <property name="receives_default">False</property>
966 <property name="xalign">0</property>
967 <property name="draw_indicator">True</property>
968 <property name="group">unity_local_menus</property>
969 </object>
970 <packing>
971 <property name="expand">False</property>
972 <property name="fill">True</property>
973 <property name="position">1</property>
974 </packing>
975 </child>
976 <child>
977 <object class="GtkRadioButton" id="unity_local_menus">
978 <property name="label" translatable="yes">In the window's title bar</property>
979 <property name="visible">True</property>
980 <property name="can_focus">True</property>
981 <property name="receives_default">False</property>
982 <property name="xalign">0</property>
983 <property name="draw_indicator">True</property>
984 <property name="group">unity_global_menus</property>
985 </object>
986 <packing>
987 <property name="expand">False</property>
988 <property name="fill">True</property>
989 <property name="position">2</property>
990 </packing>
991 </child>
992 </object>
993 <packing>
994 <property name="expand">False</property>
995 <property name="fill">True</property>
996 <property name="position">1</property>
997 </packing>
998 </child>1114 </child>
999 </object>1115 </object>
1000 <packing>1116 <packing>
@@ -1004,71 +1120,66 @@
1004 </packing>1120 </packing>
1005 </child>1121 </child>
1006 <child>1122 <child>
1007 <object class="GtkBox" id="unity_menus_visibility_box">1123 <object class="GtkBox">
1008 <property name="visible">True</property>1124 <property name="visible">True</property>
1009 <property name="can_focus">False</property>1125 <property name="can_focus">False</property>
1010 <property name="orientation">vertical</property>1126 <property name="orientation">vertical</property>
1011 <child>1127 <property name="spacing">2</property>
1012 <object class="GtkLabel" id="label5">1128 <child>
1013 <property name="visible">True</property>1129 <object class="GtkBox">
1014 <property name="can_focus">False</property>1130 <property name="visible">True</property>
1015 <property name="xalign">0</property>1131 <property name="can_focus">False</property>
1016 <property name="label" translatable="yes">&lt;b&gt;Menus visibility&lt;/b&gt;</property>1132 <property name="spacing">5</property>
1133 <child>
1134 <object class="GtkRadioButton" id="unity_gfx_mode_low_enable">
1135 <property name="label" translatable="yes">Low</property>
1136 <property name="visible">True</property>
1137 <property name="can_focus">True</property>
1138 <property name="receives_default">False</property>
1139 <property name="active">True</property>
1140 <property name="draw_indicator">True</property>
1141 </object>
1142 <packing>
1143 <property name="expand">False</property>
1144 <property name="fill">False</property>
1145 <property name="position">0</property>
1146 </packing>
1147 </child>
1148 <child>
1149 <object class="GtkRadioButton" id="unity_gfx_mode_full_enable">
1150 <property name="label" translatable="yes">High</property>
1151 <property name="visible">True</property>
1152 <property name="can_focus">True</property>
1153 <property name="receives_default">False</property>
1154 <property name="draw_indicator">True</property>
1155 <property name="group">unity_gfx_mode_low_enable</property>
1156 </object>
1157 <packing>
1158 <property name="expand">False</property>
1159 <property name="fill">False</property>
1160 <property name="position">1</property>
1161 </packing>
1162 </child>
1163 </object>
1164 <packing>
1165 <property name="expand">False</property>
1166 <property name="fill">True</property>
1167 <property name="position">0</property>
1168 </packing>
1169 </child>
1170 <child>
1171 <object class="GtkLabel">
1172 <property name="name">5</property>
1173 <property name="visible">True</property>
1174 <property name="can_focus">False</property>
1175 <property name="margin_top">5</property>
1176 <property name="label" translatable="yes">&lt;small&gt;Includes shadows and animations when opening, resizing and switching windows.&lt;/small&gt;</property>
1017 <property name="use_markup">True</property>1177 <property name="use_markup">True</property>
1018 <accessibility>1178 </object>
1019 <relation type="label-for" target="unity_global_menus"/>1179 <packing>
1020 <relation type="label-for" target="unity_local_menus"/>1180 <property name="expand">False</property>
1021 </accessibility>1181 <property name="fill">False</property>
1022 </object>1182 <property name="pack_type">end</property>
1023 <packing>
1024 <property name="expand">False</property>
1025 <property name="fill">True</property>
1026 <property name="position">0</property>
1027 </packing>
1028 </child>
1029 <child>
1030 <object class="GtkBox" id="unity_menus_visibility_type_box">
1031 <property name="visible">True</property>
1032 <property name="can_focus">False</property>
1033 <property name="margin_left">10</property>
1034 <property name="margin_top">9</property>
1035 <property name="orientation">vertical</property>
1036 <child>
1037 <object class="GtkRadioButton" id="unity_auto_hide_menus">
1038 <property name="label" translatable="yes">Displayed on mouse hovering</property>
1039 <property name="visible">True</property>
1040 <property name="can_focus">True</property>
1041 <property name="receives_default">False</property>
1042 <property name="xalign">0</property>
1043 <property name="draw_indicator">True</property>
1044 <property name="group">unity_always_show_menus</property>
1045 </object>
1046 <packing>
1047 <property name="expand">False</property>
1048 <property name="fill">True</property>
1049 <property name="position">1</property>
1050 </packing>
1051 </child>
1052 <child>
1053 <object class="GtkRadioButton" id="unity_always_show_menus">
1054 <property name="label" translatable="yes">Always displayed</property>
1055 <property name="visible">True</property>
1056 <property name="can_focus">True</property>
1057 <property name="receives_default">False</property>
1058 <property name="xalign">0</property>
1059 <property name="draw_indicator">True</property>
1060 <property name="group">unity_auto_hide_menus</property>
1061 </object>
1062 <packing>
1063 <property name="expand">False</property>
1064 <property name="fill">True</property>
1065 <property name="position">2</property>
1066 </packing>
1067 </child>
1068 </object>
1069 <packing>
1070 <property name="expand">False</property>
1071 <property name="fill">True</property>
1072 <property name="position">1</property>1183 <property name="position">1</property>
1073 </packing>1184 </packing>
1074 </child>1185 </child>
@@ -1076,37 +1187,50 @@
1076 <packing>1187 <packing>
1077 <property name="expand">False</property>1188 <property name="expand">False</property>
1078 <property name="fill">True</property>1189 <property name="fill">True</property>
1079 <property name="position">1</property>1190 <property name="position">4</property>
1080 </packing>1191 </packing>
1081 </child>1192 </child>
1082 </object>1193 </object>
1083 <packing>1194 <packing>
1084 <property name="expand">False</property>1195 <property name="expand">False</property>
1085 <property name="fill">True</property>1196 <property name="fill">True</property>
1086 <property name="padding">5</property>
1087 <property name="position">0</property>1197 <property name="position">0</property>
1088 </packing>1198 </packing>
1089 </child>1199 </child>
1090 <child>1200 </object>
1091 <object class="GtkSeparator" id="menu_separator">1201 <packing>
1092 <property name="visible">True</property>1202 <property name="expand">False</property>
1093 <property name="can_focus">False</property>1203 <property name="fill">True</property>
1094 </object>1204 <property name="position">6</property>
1095 <packing>1205 </packing>
1096 <property name="expand">False</property>1206 </child>
1097 <property name="fill">True</property>1207 <child>
1098 <property name="position">1</property>1208 <object class="GtkSeparator" id="unity_gfx_mode_separator">
1099 </packing>1209 <property name="visible">True</property>
1100 </child>1210 <property name="can_focus">False</property>
1101 </object>1211 </object>
1102 <packing>1212 <packing>
1103 <property name="expand">False</property>1213 <property name="expand">False</property>
1104 <property name="fill">True</property>1214 <property name="fill">True</property>
1105 <property name="position">4</property>1215 <property name="position">7</property>
1106 </packing>1216 </packing>
1107 </child>1217 </child>
1108 <child>1218 <child>
1109 <object class="GtkBox" id="box5">1219 <object class="GtkLabel" id="unity-label-external-tool">
1220 <property name="can_focus">False</property>
1221 <property name="xpad">12</property>
1222 <property name="label" translatable="yes">Some settings have been overriden by an external program, press "Restore Default Behaviors" to reset the behavior and return control to this panel.</property>
1223 <property name="wrap">True</property>
1224 <property name="xalign">0</property>
1225 </object>
1226 <packing>
1227 <property name="expand">False</property>
1228 <property name="fill">True</property>
1229 <property name="position">8</property>
1230 </packing>
1231 </child>
1232 <child>
1233 <object class="GtkBox" id="restore_box">
1110 <property name="height_request">36</property>1234 <property name="height_request">36</property>
1111 <property name="visible">True</property>1235 <property name="visible">True</property>
1112 <property name="can_focus">False</property>1236 <property name="can_focus">False</property>
@@ -1133,7 +1257,7 @@
1133 <packing>1257 <packing>
1134 <property name="expand">False</property>1258 <property name="expand">False</property>
1135 <property name="fill">True</property>1259 <property name="fill">True</property>
1136 <property name="position">7</property>1260 <property name="position">9</property>
1137 </packing>1261 </packing>
1138 </child>1262 </child>
1139 </object>1263 </object>
@@ -1155,13 +1279,4 @@
1155 </object>1279 </object>
1156 </child>1280 </child>
1157 </object>1281 </object>
1158 <object class="GtkSizeGroup" id="sizegroup">
1159 <property name="mode">vertical</property>
1160 <widgets>
1161 <widget name="sources-combobox"/>
1162 <widget name="heading-hbox"/>
1163 <widget name="slide-label"/>
1164 <widget name="strut"/>
1165 </widgets>
1166 </object>
1167</interface>1282</interface>
11681283
=== modified file 'panels/appearance/cc-appearance-panel.c'
--- panels/appearance/cc-appearance-panel.c 2017-06-27 23:35:32 +0000
+++ panels/appearance/cc-appearance-panel.c 2017-06-27 23:35:33 +0000
@@ -131,6 +131,7 @@
131#define UNITY_FAVORITES_KEY "favorites"131#define UNITY_FAVORITES_KEY "favorites"
132#define UNITY_INTEGRATED_MENUS_KEY "integrated-menus"132#define UNITY_INTEGRATED_MENUS_KEY "integrated-menus"
133#define UNITY_ALWAYS_SHOW_MENUS_KEY "always-show-menus"133#define UNITY_ALWAYS_SHOW_MENUS_KEY "always-show-menus"
134#define UNITY_LOWGFX_KEY "lowgfx"
134#define SHOW_DESKTOP_UNITY_FAVORITE_STR "unity://desktop-icon"135#define SHOW_DESKTOP_UNITY_FAVORITE_STR "unity://desktop-icon"
135136
136#define MIN_ICONSIZE 16.0137#define MIN_ICONSIZE 16.0
@@ -1976,6 +1977,7 @@
1976 gboolean has_menu_settings = has_setting && unity_own_setting_exists (self, UNITY_ALWAYS_SHOW_MENUS_KEY);1977 gboolean has_menu_settings = has_setting && unity_own_setting_exists (self, UNITY_ALWAYS_SHOW_MENUS_KEY);
1977 gtk_widget_set_visible (WID ("unity_menus_location_box"), has_setting);1978 gtk_widget_set_visible (WID ("unity_menus_location_box"), has_setting);
1978 gtk_widget_set_visible (WID ("unity_menus_box"), has_menu_settings);1979 gtk_widget_set_visible (WID ("unity_menus_box"), has_menu_settings);
1980 gtk_widget_set_visible (WID ("unity_menus_separator"), has_menu_settings);
19791981
1980 if (!has_setting)1982 if (!has_setting)
1981 return;1983 return;
@@ -2016,6 +2018,7 @@
2016 gboolean has_menu_settings = has_setting && unity_own_setting_exists (self, UNITY_INTEGRATED_MENUS_KEY);2018 gboolean has_menu_settings = has_setting && unity_own_setting_exists (self, UNITY_INTEGRATED_MENUS_KEY);
2017 gtk_widget_set_visible (WID ("unity_menus_location_box"), has_setting);2019 gtk_widget_set_visible (WID ("unity_menus_location_box"), has_setting);
2018 gtk_widget_set_visible (WID ("unity_menus_box"), has_menu_settings);2020 gtk_widget_set_visible (WID ("unity_menus_box"), has_menu_settings);
2021 gtk_widget_set_visible (WID ("unity_menus_separator"), has_menu_settings);
20192022
2020 if (!has_setting)2023 if (!has_setting)
2021 return;2024 return;
@@ -2047,6 +2050,68 @@
2047 menuvisibility_widget_refresh (self);2050 menuvisibility_widget_refresh (self);
2048}2051}
20492052
2053static gboolean
2054is_compiz_profile_available (const gchar *profile)
2055{
2056 gboolean is_available;
2057 gchar *profile_path;
2058
2059 profile_path = g_strdup_printf ("%s/compiz-1/compizconfig/%s.ini",
2060 g_get_user_config_dir (), profile);
2061 is_available = g_file_test (profile_path, G_FILE_TEST_EXISTS);
2062 g_free (profile_path);
2063
2064 if (!is_available)
2065 {
2066 profile_path = g_strdup_printf ("/etc/compizconfig/%s.ini", profile);
2067 is_available = g_file_test (profile_path, G_FILE_TEST_EXISTS);
2068 g_free (profile_path);
2069 }
2070
2071 return is_available;
2072}
2073
2074static void
2075gfx_mode_widget_refresh (CcAppearancePanel *self)
2076{
2077 CcAppearancePanelPrivate *priv = self->priv;
2078 gboolean has_setting = unity_own_setting_exists (self, UNITY_LOWGFX_KEY);
2079 gboolean has_profile = is_compiz_profile_available (UNITY_NORMAL_PROFILE) &&
2080 is_compiz_profile_available (UNITY_LOWGFX_PROFILE);
2081
2082 gtk_widget_set_visible (WID ("unity_gfx_mode_box"), has_setting && has_profile);
2083 gtk_widget_set_visible (WID ("unity_gfx_mode_separator"), has_setting && has_profile);
2084
2085 if (!has_setting || !has_profile)
2086 return;
2087
2088 gboolean enable_lowgfx = g_settings_get_boolean (priv->unity_own_settings, UNITY_LOWGFX_KEY);
2089
2090 if (enable_lowgfx == FALSE)
2091 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("unity_gfx_mode_full_enable")), TRUE);
2092 else
2093 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("unity_gfx_mode_low_enable")), TRUE);
2094}
2095
2096static void
2097on_gfx_mode_changed (GtkToggleButton *button,
2098 gpointer user_data)
2099{
2100 CcAppearancePanel *self = CC_APPEARANCE_PANEL (user_data);
2101 CcAppearancePanelPrivate *priv = self->priv;
2102
2103 gboolean low_enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("unity_gfx_mode_low_enable")));
2104 g_settings_set_boolean (priv->unity_own_settings, UNITY_LOWGFX_KEY, low_enabled);
2105}
2106
2107static void
2108ext_lowgfx_changed_callback (GroupedGSettings* compiz_gs,
2109 gchar *key,
2110 gpointer user_data)
2111{
2112 gfx_mode_widget_refresh (CC_APPEARANCE_PANEL (user_data));
2113}
2114
2050static void2115static void
2051ext_compiz_profile_changed_callback (GSettings* compiz_settings,2116ext_compiz_profile_changed_callback (GSettings* compiz_settings,
2052 gchar *key,2117 gchar *key,
@@ -2090,6 +2155,9 @@
2090 if (unity_own_setting_exists (self, UNITY_ALWAYS_SHOW_MENUS_KEY))2155 if (unity_own_setting_exists (self, UNITY_ALWAYS_SHOW_MENUS_KEY))
2091 g_settings_reset (priv->unity_own_settings, UNITY_ALWAYS_SHOW_MENUS_KEY);2156 g_settings_reset (priv->unity_own_settings, UNITY_ALWAYS_SHOW_MENUS_KEY);
20922157
2158 if (unity_own_setting_exists (self, UNITY_LOWGFX_KEY))
2159 g_settings_reset (priv->unity_own_settings, UNITY_LOWGFX_KEY);
2160
2093 GtkToggleButton *showdesktop = GTK_TOGGLE_BUTTON (WID ("check_showdesktop_in_launcher"));2161 GtkToggleButton *showdesktop = GTK_TOGGLE_BUTTON (WID ("check_showdesktop_in_launcher"));
2094 gtk_toggle_button_set_active(showdesktop, TRUE);2162 gtk_toggle_button_set_active(showdesktop, TRUE);
2095}2163}
@@ -2266,6 +2334,15 @@
2266 G_CALLBACK (on_menuvisibility_changed), self);2334 G_CALLBACK (on_menuvisibility_changed), self);
2267 menuvisibility_widget_refresh (self);2335 menuvisibility_widget_refresh (self);
22682336
2337 /* Low gfx */
2338 g_signal_connect (priv->unity_own_settings, "changed::" UNITY_LOWGFX_KEY,
2339 G_CALLBACK (ext_lowgfx_changed_callback), self);
2340 g_signal_connect (WID ("unity_gfx_mode_full_enable"), "toggled",
2341 G_CALLBACK (on_gfx_mode_changed), self);
2342 g_signal_connect (WID ("unity_gfx_mode_low_enable"), "toggled",
2343 G_CALLBACK (on_gfx_mode_changed), self);
2344 gfx_mode_widget_refresh (self);
2345
2269 /* Restore defaut on second page */2346 /* Restore defaut on second page */
2270 g_signal_connect (WID ("button-restore-unitybehavior"), "clicked",2347 g_signal_connect (WID ("button-restore-unitybehavior"), "clicked",
2271 G_CALLBACK (on_restore_defaults_page2_clicked), self);2348 G_CALLBACK (on_restore_defaults_page2_clicked), self);

Subscribers

People subscribed via source and target branches