[Xfce4-commits] <ristretto:master> Improve ordering of monitors

Stephan Arts noreply at xfce.org
Sat Dec 3 12:40:02 CET 2011


Updating branch refs/heads/master
         to 0b7db02de42dd771c0844fa17deb0c095b35599b (commit)
       from 111ff43834b06ef4920bc6656938b60f9db53787 (commit)

commit 0b7db02de42dd771c0844fa17deb0c095b35599b
Author: Stephan Arts <stephan at xfce.org>
Date:   Sat Dec 3 12:37:12 2011 +0100

    Improve ordering of monitors

 src/monitor_chooser.c |   51 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/src/monitor_chooser.c b/src/monitor_chooser.c
index 42c0743..fbe06bd 100644
--- a/src/monitor_chooser.c
+++ b/src/monitor_chooser.c
@@ -311,21 +311,42 @@ rstto_monitor_chooser_paint(GtkWidget *widget)
 
                 label = g_strdup_printf("%d", id+1);
                 cairo_save (ctx);
-                paint_monitor (
-                        widget,
-                        ctx,
-                        ((gdouble)widget->allocation.width/2)+
-                            (((gdouble)widget->allocation.width/2)/
-                            (row_width+1))*(id%(row_width)+1)-
-                            (width/2.0),
-                        ((gdouble)widget->allocation.height/
-                            (row_width+2)*(id/row_width+1))-
-                            (height/2.0),
-                        width,
-                        height,
-                        label,
-                        monitor,
-                        FALSE);
+                if (id < chooser->priv->selected)
+                {
+                    paint_monitor (
+                            widget,
+                            ctx,
+                            ((gdouble)widget->allocation.width/2)+
+                                (((gdouble)widget->allocation.width/2)/
+                                (row_width+1))*(id%(row_width)+1)-
+                                (width/2.0),
+                            ((gdouble)widget->allocation.height/
+                                (row_width+2)*(id/row_width+1))-
+                                (height/2.0),
+                            width,
+                            height,
+                            label,
+                            monitor,
+                            FALSE);
+                }
+                else
+                {
+                    paint_monitor (
+                            widget,
+                            ctx,
+                            ((gdouble)widget->allocation.width/2)+
+                                (((gdouble)widget->allocation.width/2)/
+                                (row_width+1))*((id-1)%(row_width)+1)-
+                                (width/2.0),
+                            ((gdouble)widget->allocation.height/
+                                (row_width+2)*((id-1)/row_width+1))-
+                                (height/2.0),
+                            width,
+                            height,
+                            label,
+                            monitor,
+                            FALSE);
+                }
                 cairo_restore (ctx);
                 g_free (label);
             }


More information about the Xfce4-commits mailing list