[chronojump] Added icon and method to display which Cairo graphs are clickable



commit 7e0cbffa22b65ddf3b6f839c6990b4fb11a4a420
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Mar 21 12:58:22 2022 +0100

    Added icon and method to display which Cairo graphs are clickable

 images/md/outline_mouse_black_18dp.png | Bin 0 -> 265 bytes
 src/Makefile.am                        |   1 +
 src/gui/cairo/generic.cs               |  11 ++++++++++-
 src/gui/cairo/xy.cs                    |   2 +-
 4 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/images/md/outline_mouse_black_18dp.png b/images/md/outline_mouse_black_18dp.png
new file mode 100644
index 000000000..12540ba54
Binary files /dev/null and b/images/md/outline_mouse_black_18dp.png differ
diff --git a/src/Makefile.am b/src/Makefile.am
index 03639f9fe..b5bfbda06 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -521,6 +521,7 @@ RESOURCES = \
        ../images/md/ic_group_add_blue_1x.png,image_group_add.png \
        ../images/md/p_outline_blue_1x.png,image_person_outline.png \
        ../images/md/image_group_outline.png,image_group_outline.png \
+       ../images/md/outline_mouse_black_18dp.png,mouse.png \
        ../images/md/ic_weekend_blue_1x.png,image_rest.png \
        ../images/md/ic_weekend_blue_inactive_1x.png,image_rest_inactive.png \
        ../images/md/ic_weekend_yellow_1x.png,image_rest_yellow.png \
diff --git a/src/gui/cairo/generic.cs b/src/gui/cairo/generic.cs
index 2cbe4f60d..b70987977 100644
--- a/src/gui/cairo/generic.cs
+++ b/src/gui/cairo/generic.cs
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Copyright (C) 2004-2020   Xavier de Blas <xaviblas gmail com> 
+ *  Copyright (C) 2004-2022   Xavier de Blas <xaviblas gmail com>
  */
 
 using System;
@@ -324,6 +324,15 @@ public abstract class CairoGeneric
                g.SetSourceRGB(0,0,0);
        }
 
+       protected void addClickableMark (Cairo.Context g)
+       {
+               Gdk.Pixbuf pixbuf = new Gdk.Pixbuf (null, Util.GetImagePath(false) + "mouse.png"); //18px
+               Gdk.CairoHelper.SetSourcePixbuf (g, pixbuf,
+                               graphWidth -rightMargin -18,// -4,
+                               graphHeight - bottomMargin -18 -4);
+               g.Paint();
+       }
+
        /*
         * adapted to not used LinQ from:
         * https://stackoverflow.com/questions/237220/tickmark-algorithm-for-a-graph-axis
diff --git a/src/gui/cairo/xy.cs b/src/gui/cairo/xy.cs
index 1a623f256..72cfa8be8 100644
--- a/src/gui/cairo/xy.cs
+++ b/src/gui/cairo/xy.cs
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Copyright (C) 2004-2021   Xavier de Blas <xaviblas gmail com>
+ *  Copyright (C) 2004-2022   Xavier de Blas <xaviblas gmail com>
  */
 
 using System;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]