summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarosg <[email protected]>2017-09-07 07:31:37 +0200
committermarosg <[email protected]>2017-09-08 16:14:45 +0200
commit5fedc5bcdc4f276709552ca40958442151bb97b4 (patch)
tree05e0ec708ed8625bb41725808c8300af9b381e9f
parent14a072cd5c936ae75e5df1c2dc25610716fb41e7 (diff)
downloadmate-applets-5fedc5bcdc4f276709552ca40958442151bb97b4.tar.bz2
mate-applets-5fedc5bcdc4f276709552ca40958442151bb97b4.tar.xz
GSettings for checkmark color shown for mounted volumes.
-rw-r--r--configure.ac1
-rw-r--r--drivemount/Makefile.am24
-rw-r--r--drivemount/drive-button.c17
-rw-r--r--drivemount/drive-button.h1
-rw-r--r--drivemount/drive-list.h1
-rw-r--r--drivemount/drivemount.c2
-rw-r--r--drivemount/org.mate.drivemount.gschema.xml.in9
7 files changed, 43 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index ebbd5ce3..c32a8035 100644
--- a/configure.ac
+++ b/configure.ac
@@ -542,6 +542,7 @@ accessx-status/docs/Makefile
accessx-status/pixmaps/Makefile
drivemount/Makefile
drivemount/help/Makefile
+drivemount/org.mate.drivemount.gschema.xml
multiload/Makefile
multiload/org.mate.panel.applet.multiload.gschema.xml
multiload/docs/Makefile
diff --git a/drivemount/Makefile.am b/drivemount/Makefile.am
index dc0f225b..328f08f1 100644
--- a/drivemount/Makefile.am
+++ b/drivemount/Makefile.am
@@ -20,6 +20,20 @@ mate_drivemount_applet_LDADD = \
$(MATE_APPLETS4_LIBS) \
$(MATEDESKTOP_LIBS)
+uidir = $(datadir)/mate/ui
+ui_DATA = drivemount-applet-menu.xml
+
+@INTLTOOL_XML_NOMERGE_RULE@
+drivemount_gschema_in_files = org.mate.drivemount.gschema.xml.in
+gsettings_SCHEMAS = $(drivemount_gschema_in_files:.xml.in=.xml)
+@GSETTINGS_RULES@
+
+EXTRA_DIST = \
+ org.mate.applets.DriveMountApplet.mate-panel-applet.in.in \
+ $(service_in_files) \
+ $(drivemount_gschema_in_files) \
+ $(ui_DATA)
+
appletdir = $(datadir)/mate-panel/applets
applet_in_files = org.mate.applets.DriveMountApplet.mate-panel-applet.in
@@ -42,14 +56,6 @@ org.mate.panel.applet.DriveMountAppletFactory.service: $(service_in_files)
-e "s|\@LIBEXECDIR\@|$(libexecdir)|" \
$< > $@
-uidir = $(datadir)/mate/ui
-ui_DATA = drivemount-applet-menu.xml
-
-CLEANFILES = $(applet_DATA) $(applet_DATA).in $(service_DATA)
-
-EXTRA_DIST = \
- org.mate.applets.DriveMountApplet.mate-panel-applet.in.in \
- $(service_in_files) \
- $(ui_DATA)
+CLEANFILES = $(applet_DATA) $(applet_DATA).in $(service_DATA) $(gsettings_SCHEMAS) *.gschema.valid
-include $(top_srcdir)/git.mk
diff --git a/drivemount/drive-button.c b/drivemount/drive-button.c
index fdaad0a2..ff766fcb 100644
--- a/drivemount/drive-button.c
+++ b/drivemount/drive-button.c
@@ -485,6 +485,17 @@ drive_button_update (gpointer user_data)
rowstride = gdk_pixbuf_get_rowstride (tmp_pixbuf);
pixels = gdk_pixbuf_get_pixels (tmp_pixbuf);
+ GdkRGBA color;
+ gchar *color_string = g_settings_get_string (settings, "drivemount-checkmark-color");
+ if (!color_string)
+ color_string = g_strdup ("#00ff00");
+ gdk_rgba_parse (&color, color_string);
+ g_free (color_string);
+
+ guchar red = color.red*255;
+ guchar green = color.green*255;
+ guchar blue = color.blue*255;
+
const gdouble ratio = 0.65;
gdouble y_start = icon_height * ratio;
gdouble x_start = icon_height * (1 + ratio);
@@ -493,9 +504,9 @@ drive_button_update (gpointer user_data)
for (x = x_start - y; x < icon_width; x++)
{
p = pixels + y * rowstride + x * n_channels;
- p[0] = 0;
- p[1] = 230;
- p[2] = 0;
+ p[0] = red;
+ p[1] = green;
+ p[2] = blue;
p[3] = 255;
}
}
diff --git a/drivemount/drive-button.h b/drivemount/drive-button.h
index f0c3389d..10ba3a35 100644
--- a/drivemount/drive-button.h
+++ b/drivemount/drive-button.h
@@ -63,6 +63,7 @@ void drive_button_set_size (DriveButton *button,
int drive_button_compare (DriveButton *button,
DriveButton *other_button);
+GSettings *settings;
G_END_DECLS
diff --git a/drivemount/drive-list.h b/drivemount/drive-list.h
index 283aeb6d..d74b934a 100644
--- a/drivemount/drive-list.h
+++ b/drivemount/drive-list.h
@@ -65,5 +65,6 @@ void drive_list_set_panel_size (DriveList *list,
int panel_size);
void drive_list_set_transparent (DriveList *self,
gboolean transparent);
+GSettings *settings;
#endif /* DRIVE_LIST_H */
diff --git a/drivemount/drivemount.c b/drivemount/drivemount.c
index 3e0bdd2b..7d10a1d6 100644
--- a/drivemount/drivemount.c
+++ b/drivemount/drivemount.c
@@ -190,6 +190,8 @@ applet_factory (MatePanelApplet *applet,
mate_panel_applet_set_flags (applet, MATE_PANEL_APPLET_EXPAND_MINOR);
mate_panel_applet_set_background_widget (applet, GTK_WIDGET (applet));
+ settings = g_settings_new ( "org.mate.drivemount");
+
drive_list = drive_list_new ();
gtk_container_add (GTK_CONTAINER (applet), drive_list);
diff --git a/drivemount/org.mate.drivemount.gschema.xml.in b/drivemount/org.mate.drivemount.gschema.xml.in
new file mode 100644
index 00000000..24ffe871
--- /dev/null
+++ b/drivemount/org.mate.drivemount.gschema.xml.in
@@ -0,0 +1,9 @@
+<schemalist gettext-domain="@GETTEXT_PACKAGE@">
+ <schema id="org.mate.drivemount" path="/org/mate/panel/drivemount/">
+ <key name="drivemount-checkmark-color" type="s">
+ <default>'#00e300'</default>
+ <summary>Checkmark color for mounted drive or share</summary>
+ <description>Default color in a hex value.</description>
+ </key>
+ </schema>
+</schemalist>