[gcalctool] Fix broken widget style



commit 5f4f89d9974febe777d29a65e6bb1b8dc00f2f5a
Author: Robert Ancell <robert ancell gmail com>
Date:   Wed May 27 13:45:23 2009 +0200

    Fix broken widget style
---
 ChangeLog        |    1 +
 data/gcalctoolrc |  203 +++++++++++++++++++++++------------------------------
 src/gtk.c        |    4 +-
 3 files changed, 90 insertions(+), 118 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 843fa10..9c46bf5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,7 @@ gcalctool change history.
 2009-05-27 Robert Ancell <robert ancell gmail com>
 
     * Focus on the display entry by default
+    * Fix broken widget style.  Copy gcalctoolrc to ~/.gcalctoolrc to get coloured buttons.
 
 2009-05-26 Robert Ancell <robert ancell gmail com>
 
diff --git a/data/gcalctoolrc b/data/gcalctoolrc
index 3c7201e..0885f20 100644
--- a/data/gcalctoolrc
+++ b/data/gcalctoolrc
@@ -39,121 +39,94 @@ style "dark-bg"
 
 }
 
-# Basic mode colors
-
-widget "*bas_button0*" style "light-bg" # Bksp
-widget "*bas_button1*" style "light-bg" # CE
-widget "*bas_button2*" style "light-bg" # Clr
-widget "*bas_button3*" style "light-bg" # +/-
-
-
-widget "*bas_button16*" style "light-bg" # 0
-widget "*bas_button12*" style "light-bg" # 1
-widget "*bas_button13*" style "light-bg" # 2
-widget "*bas_button14*" style "light-bg" # 3 
-widget "*bas_button8*" style "light-bg"  # 4
-widget "*bas_button9*" style "light-bg"  # 5
-widget "*bas_button10*" style "light-bg" # 6
-widget "*bas_button4*" style "light-bg"  # 7
-widget "*bas_button5*" style "light-bg"  # 8
-widget "*bas_button6*" style "light-bg"  # 9
-widget "*bas_button17*" style "light-bg" # .
-
-widget "*bas_button11*" style "mid-bg"  # *
-widget "*bas_button7*" style "mid-bg"   # /
-widget "*bas_button15*" style "mid-bg"  # -
-widget "*bas_button19*" style "mid-bg"  # +
- 
-widget "*bas_button18*" style "dark-bg" # =
-
-
-# Advanced mode colors (also apply to Scientific and Financial modes)
-
-widget "*adv_button24*" style "light-bg" # 0
-widget "*adv_button16*" style "light-bg" # 1
-widget "*adv_button17*" style "light-bg" # 2
-widget "*adv_button18*" style "light-bg" # 3
-widget "*adv_button8*" style "light-bg"  # 4 
-widget "*adv_button9*" style "light-bg"  # 5
-widget "*adv_button10*" style "light-bg" # 6
-widget "*adv_button0*" style "light-bg"  # 7
-widget "*adv_button1*" style "light-bg"  # 8
-widget "*adv_button2*" style "light-bg"  # 9
-
-widget "*adv_button3*" style "mid-bg"   # /
-widget "*adv_button4*" style "dark-bg"  # (
-widget "*adv_button5*" style "light-bg" # Bksp
-widget "*adv_button6*" style "light-bg" # CE
-widget "*adv_button7*" style "light-bg" # Clr
-
-widget "*adv_button11*" style "mid-bg"  # *
-widget "*adv_button12*" style "dark-bg" # )
-widget "*adv_button13*" style "light-bg"# +/-
-widget "*adv_button14*" style "dark-bg" # Int
-widget "*adv_button15*" style "mid-bg"  # Sto
-
-widget "*adv_button19*" style "mid-bg"  # -
-widget "*adv_button20*" style "dark-bg" # %
-widget "*adv_button21*" style "mid-bg" # Sqrt
-widget "*adv_button22*" style "dark-bg" # Frac
-widget "*adv_button23*" style "mid-bg"  # Rcl
-
-widget "*adv_button25*" style "light-bg"# .
-widget "*adv_button26*" style "dark-bg" # =
-widget "*adv_button27*" style "mid-bg"  # +
-widget "*adv_button28*" style "mid-bg" # 1/x
-widget "*adv_button29*" style "mid-bg" # x^2
-widget "*adv_button30*" style "dark-bg" # Abs
-widget "*adv_button31*" style "mid-bg" # Exch
-
-
-# Financial mode colours
-
-widget "*fin_button0*" style "mid-bg" # Ctrm
-widget "*fin_button1*" style "mid-bg" # Ddb
-widget "*fin_button2*" style "mid-bg" # Fv
-widget "*fin_button3*" style "mid-bg" # Pmt
-widget "*fin_button4*" style "mid-bg" # Pv
-widget "*fin_button5*" style "mid-bg" # Rate
-widget "*fin_button6*" style "mid-bg" # Sln
-widget "*fin_button7*" style "mid-bg" # Syd
-widget "*fin_button8*" style "mid-bg" # Term
-
-# Scientific mode colours
-
-widget "*sci_button0*" style "dark-bg" # <
-widget "*sci_button1*" style "dark-bg" # >
-widget "*sci_button2*" style "dark-bg" # &16
-widget "*sci_button3*" style "dark-bg" # &32
-widget "*sci_button7*" style "mid-bg" # Acc
-
-widget "*sci_button8*" style "light-bg" # Con
-widget "*sci_button9*" style "mid-bg" # Fun
-widget "*sci_button10*" style "mid-bg" # Exp
-widget "*sci_button11*" style "mid-bg" # e^x
-widget "*sci_button12*" style "mid-bg" # 10^x
-widget "*sci_button13*" style "mid-bg" # x^y
-widget "*sci_button14*" style "mid-bg" # !
-widget "*sci_button15*" style "light-bg" # Rand
-
-widget "*sci_button24*" style "light-bg" # A
-widget "*sci_button25*" style "light-bg" # B
-widget "*sci_button26*" style "light-bg" # C
-widget "*sci_button16*" style "light-bg" # D
-widget "*sci_button17*" style "light-bg" # E
-widget "*sci_button18*" style "light-bg" # F
-
-widget "*sci_button19*" style "dark-bg" # Cos
-widget "*sci_button20*" style "dark-bg" # Sin
-widget "*sci_button21*" style "dark-bg" # Tan
-widget "*sci_button22*" style "dark-bg" # Ln
-widget "*sci_button23*" style "dark-bg" # Log
-
-widget "*sci_button27*" style "mid-bg" # Or
-widget "*sci_button28*" style "mid-bg" # And
-widget "*sci_button29*" style "mid-bg" # Not
-widget "*sci_button30*" style "mid-bg" # Xor
-widget "*sci_button31*" style "mid-bg" # Xnor
+widget "*calc_0_button*" style "light-bg"
+widget "*calc_1_button*" style "light-bg"
+widget "*calc_2_button*" style "light-bg"
+widget "*calc_3_button*" style "light-bg"
+widget "*calc_4_button*" style "light-bg"
+widget "*calc_5_button*" style "light-bg"
+widget "*calc_6_button*" style "light-bg"
+widget "*calc_7_button*" style "light-bg"
+widget "*calc_8_button*" style "light-bg"
+widget "*calc_9_button*" style "light-bg"
+widget "*calc_a_button*" style "light-bg"
+widget "*calc_b_button*" style "light-bg"
+widget "*calc_c_button*" style "light-bg"
+widget "*calc_d_button*" style "light-bg"
+widget "*calc_e_button*" style "light-bg"
+widget "*calc_f_button*" style "light-bg"
+widget "*calc_numeric_point_button*" style "light-bg"
+
+widget "*calc_multiply_button*"  style "mid-bg"
+widget "*calc_divide_button*"    style "mid-bg"
+widget "*calc_subtract_button*"  style "mid-bg"
+widget "*calc_add_button*"       style "mid-bg"
+widget "*calc_result_button*"    style "dark-bg"
+
+widget "*calc_backspace_simple_button*" style "light-bg"
+widget "*calc_backspace_advanced_button*" style "light-bg"
+widget "*calc_clear_entry_simple_button" style "light-bg"
+widget "*calc_clear_entry_advanced_button" style "light-bg"
+widget "*calc_clear_simple_button*" style "light-bg"
+widget "*calc_clear_advanced_button*" style "light-bg"
+widget "*calc_change_sign_simple_button*" style "light-bg"
+widget "*calc_change_sign_advanced_button*" style "light-bg"
+
+widget "*calc_start_group_button*" style "dark-bg"
+widget "*calc_end_group_button*" style "dark-bg"
+
+widget "*calc_percentage_button*" style "dark-bg"
+widget "*calc_square_button*"     style "mid-bg"
+widget "*calc_sqrt_button*"       style "mid-bg"
+widget "*calc_reciprocal_button*" style "mid-bg"
+
+widget "*calc_store_button*"      style "mid-bg"
+widget "*calc_recall_button*"     style "mid-bg"
+widget "*calc_exchange_button*"   style "mid-bg"
+
+widget "*calc_constants_button*"  style "light-bg"
+widget "*calc_functions_button*"  style "mid-bg"
+
+widget "*calc_exponential_button*"  style "mid-bg"
+
+widget "*calc_natural_logarithm_button*"  style "mid-bg"
+widget "*calc_logarithm_button*"  style "mid-bg"
+widget "*calc_logarithm2_button*" style "mid-bg"
+widget "*calc_x_pow_y_button*"    style "mid-bg"
+widget "*calc_factorial_button*"  style "mid-bg"
+widget "*calc_random_button*"     style "light-bg"
+
+widget "*calc_accuracy_button*"   style "mid-bg"
+widget "*calc_abs_button*"        style "dark-bg"
+
+widget "*calc_cosine_button*"     style "dark-bg"
+widget "*calc_sine_button*"       style "dark-bg"
+widget "*calc_tangent_button*"    style "dark-bg"
+
+widget "*calc_or_button*"                 style "mid-bg"
+widget "*calc_and_button*"                style "mid-bg"
+widget "*calc_not_button*"                style "mid-bg"
+widget "*calc_xor_button*"                style "mid-bg"
+widget "*calc_xnor_button*"               style "mid-bg"
+widget "*calc_modulus_divide*"            style "mid-bg"
+widget "*calc_shift_left_button*"         style "dark-bg"
+widget "*calc_shift_right_button*"        style "dark-bg"
+widget "*calc_trunc_button*"              style "dark-bg"
+widget "*calc_integer_portion_button*"    style "dark-bg"
+widget "*calc_fractional_portion_button*" style "dark-bg"
+widget "*calc_1s_button*"                 style "dark-bg"
+widget "*calc_2s_button*"                 style "dark-bg"
+
+widget "*calc_finc_compounding_term_button*"              style "mid-bg"
+widget "*calc_finc_sum_of_the_years_digits_depreciation_button*" style "mid-bg"
+widget "*calc_finc_straight_line_depreciation_button*"    style "mid-bg"
+widget "*calc_finc_periodic_interest_rate_button*"        style "mid-bg"
+widget "*calc_finc_present_value_button*"                 style "mid-bg"
+widget "*calc_finc_periodic_payment_button*"              style "mid-bg"
+widget "*calc_finc_future_value_button*"                  style "mid-bg"
+widget "*calc_finc_gross_profit_margin_button*"           style "mid-bg"
+widget "*calc_finc_double_declining_depreciation_button*" style "mid-bg"
+widget "*calc_finc_term_button*"                          style "mid-bg"
 
 widget "*displayitem*" style "light-bg"
 widget "*oplabel*" style "light-bg"
diff --git a/src/gtk.c b/src/gtk.c
index df8f9ea..1515a3b 100644
--- a/src/gtk.c
+++ b/src/gtk.c
@@ -2740,7 +2740,6 @@ void
 ui_init(int *argc, char ***argv)
 {  
     gchar *path;
-    const gchar *home;
     int value;
 
     gtk_init(argc, argv);
@@ -2754,8 +2753,7 @@ ui_init(int *argc, char ***argv)
     else
         X.mode = BASIC;
 
-    home = g_get_home_dir();
-    path = g_build_path(home, RCNAME, NULL);
+    path = g_build_filename(g_get_home_dir(), RCNAME, NULL);
     gtk_rc_parse(path);
     g_free(path);
 



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