[Goodies-commits] r7495 - in xfce4-notes-plugin/trunk: . panel-plugin
Mike Massonnet
mmassonnet at xfce.org
Sun Jun 7 15:06:38 CEST 2009
Author: mmassonnet
Date: 2009-06-07 13:06:38 +0000 (Sun, 07 Jun 2009)
New Revision: 7495
Modified:
xfce4-notes-plugin/trunk/ChangeLog
xfce4-notes-plugin/trunk/panel-plugin/application.vala
xfce4-notes-plugin/trunk/panel-plugin/window.vala
Log:
Window show/hide behavior and initial background
Modified: xfce4-notes-plugin/trunk/ChangeLog
===================================================================
--- xfce4-notes-plugin/trunk/ChangeLog 2009-06-07 12:49:51 UTC (rev 7494)
+++ xfce4-notes-plugin/trunk/ChangeLog 2009-06-07 13:06:38 UTC (rev 7495)
@@ -1,5 +1,16 @@
2009-06-07 Mike Massonnet <mmassonnet at xfce.org>
+Window show/hide behavior and initial background
+ * panel-plugin/application.vala:
+ - Set initial background color.
+ - Present all visible windows when none is active, present all
+ windows otherwise and hide all windows when all are visible.
+ * panel-plugin/window.vala:
+ - Deiconify on hide.
+ - When switching window from the Go menu, present instead of show.
+
+2009-06-07 Mike Massonnet <mmassonnet at xfce.org>
+
Drop thunarvfs reference from automake
* panel-plugin/Makefile.am:
- Drop THUNAR_VFS references.
Modified: xfce4-notes-plugin/trunk/panel-plugin/application.vala
===================================================================
--- xfce4-notes-plugin/trunk/panel-plugin/application.vala 2009-06-07 12:49:51 UTC (rev 7494)
+++ xfce4-notes-plugin/trunk/panel-plugin/application.vala 2009-06-07 13:06:38 UTC (rev 7495)
@@ -37,6 +37,8 @@
this.config_file = config_file;
xfconf_channel = new Xfconf.Channel.with_property_base ("xfce4-panel", "/plugins/notes");
+ string color = xfconf_channel.get_string ("/global/background-color", "#F2F1EF");
+ Xnp.Color.set_background (color);
xfconf_channel.property_changed += (channel, prop, val) => {
if (prop == "/global/background-color") {
Xnp.Color.set_background (val.get_string ());
@@ -426,15 +428,34 @@
* Show all the notes or hide them if they are all shown.
*/
public void show_hide_notes () {
- bool hide = true;
+ bool invisible_found = false;
+ bool visible_found = false;
+ bool active_found = false;
foreach (var win in this.window_list) {
+ if (win.is_active) {
+ active_found = true;
+ }
if (!(bool)(win.get_flags () & Gtk.WidgetFlags.VISIBLE)) {
+ invisible_found = true;
+ }
+ else {
+ visible_found = true;
+ }
+ }
+
+ foreach (var win in this.window_list) {
+ // Present visible windows
+ if (!active_found && visible_found) {
+ if ((bool)(win.get_flags () & Gtk.WidgetFlags.VISIBLE)) {
+ win.present ();
+ }
+ }
+ // Show all windows
+ else if (invisible_found) {
win.show ();
- hide = false;
}
- }
- if (hide) {
- foreach (var win in this.window_list) {
+ // Hide all windows
+ else {
win.hide ();
}
}
Modified: xfce4-notes-plugin/trunk/panel-plugin/window.vala
===================================================================
--- xfce4-notes-plugin/trunk/panel-plugin/window.vala 2009-06-07 12:49:51 UTC (rev 7494)
+++ xfce4-notes-plugin/trunk/panel-plugin/window.vala 2009-06-07 13:06:38 UTC (rev 7495)
@@ -319,6 +319,7 @@
int winx, winy;
get_position (out winx, out winy);
base.hide ();
+ deiconify ();
unshade ();
move (winx, winy);
}
@@ -741,7 +742,7 @@
mi.set_data ("window", (void*)win);
mi.activate += (i) => {
var w = (Xnp.Window)i.get_data ("window");
- w.show ();
+ w.present ();
};
menu.append (mi);
More information about the Goodies-commits
mailing list