[gnome-commander] styles: add operator = for GnomeCmdColorTheme



commit 40d2e9766869b83b8d9a4fb9c2b7e1db8871c9e8
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Fri Nov 25 21:57:39 2011 +0100

    styles: add operator = for GnomeCmdColorTheme

 src/gnome-cmd-types.h |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-cmd-types.h b/src/gnome-cmd-types.h
index ba263db..650c31b 100644
--- a/src/gnome-cmd-types.h
+++ b/src/gnome-cmd-types.h
@@ -118,9 +118,30 @@ struct GnomeCmdColorTheme
         if (alt_fg)     gdk_color_free (alt_fg);
         if (alt_bg)     gdk_color_free (alt_bg);
     }
+
+    GnomeCmdColorTheme &operator = (const GnomeCmdColorTheme &colors);
 };
 
 
+inline GnomeCmdColorTheme &GnomeCmdColorTheme::operator = (const GnomeCmdColorTheme &colors)
+{
+    if (this != &colors)
+    {
+        respect_theme = colors.respect_theme;
+        sel_fg = gdk_color_copy (colors.sel_fg);
+        sel_bg = gdk_color_copy (colors.sel_bg);
+        norm_fg = gdk_color_copy (colors.norm_fg);
+        norm_bg = gdk_color_copy (colors.norm_bg);
+        curs_fg = gdk_color_copy (colors.curs_fg);
+        curs_bg = gdk_color_copy (colors.curs_bg);
+        alt_fg = gdk_color_copy (colors.alt_fg);
+        alt_bg = gdk_color_copy (colors.alt_bg);
+    }
+
+    return *this;
+}
+
+
 struct GnomeCmdLsColorsPalette
 {
     GdkColor *black_fg, *black_bg;



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