From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19237 invoked by alias); 22 Mar 2012 14:31:52 -0000 Received: (qmail 19208 invoked by uid 22791); 22 Mar 2012 14:31:50 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,TO_NO_BRKTS_PCNT X-Spam-Check-By: sourceware.org Received: from outdoor.onevision.de (HELO outdoor.onevision.de) (212.77.172.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Mar 2012 14:31:36 +0000 Received: from sanders.onevision.de (moonrace [212.77.172.62]) by outdoor.onevision.de (8.14.3/8.13.7/ROSCH/DDB) with ESMTP id q2MEVS4v011676 for ; Thu, 22 Mar 2012 15:31:33 +0100 Received: from [192.168.5.32] ([192.168.5.32]) by sanders.onevision.de (Lotus Domino Release 8.5.1FP3) with ESMTP id 2012032215312365-123107 ; Thu, 22 Mar 2012 15:31:23 +0100 Message-ID: <4F6B37BB.9040700@onevision.com> Date: Thu, 22 Mar 2012 14:31:00 -0000 From: Roland Schwingel User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: insight@sourceware.org Subject: [PATCH] gdbtk: Make color of changed vars customizable Content-Type: multipart/mixed; boundary="------------070608080305030202080505" Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org X-SW-Source: 2012-q1/txt/msg00031.txt.bz2 This is a multi-part message in MIME format. --------------070608080305030202080505 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-length: 1185 Hi... In Insight one can change most colors beside of one. In the local variables window the changed vars are colored in (yet hardcoded) 100%green. If you have a pure white background it is sometimes hard to read as it is IMHO a little too bright and too anyoing. The attached patch fixes this. It now uses the same color as PC color from global preferences. I adjusted the "PC" color label in source prefs to "PC/Changed vars". Also I changed the default color for this field to brightest green to a somewhat darker green. Changelog: 2012-03-22 Roland Schwingel * library/locals.tcl (constructor): Take default for change color from PC_TAG prefs. (reconfig): New method for getting prefs updates. * library/srcpref.itb (_build_win): Change text of PC color chooser. * library/prefs.tcl (pref_set_defaults): Change default of PC_TAG color to a somewhat darker green. Remove hardwired color value for changed variables. * library/vartree.itb (update_var): use changed field color from global colors list. (_init_data): Remove local copy of changed vars color. Any comments? Is this ok? Roland --------------070608080305030202080505 Content-Transfer-Encoding: 7bit Content-Type: text/plain; name="custom_color_changed_vars.patch" Content-Disposition: attachment; filename="custom_color_changed_vars.patch" Content-length: 2977 diff -ruN gdbtk_orig/library/locals.tcl gdbtk/library/locals.tcl --- gdbtk_orig/library/locals.tcl 2007-01-30 16:39:21.000000000 +0100 +++ gdbtk/library/locals.tcl 2012-03-22 09:01:03.648300100 +0100 @@ -32,6 +32,9 @@ add_hook gdb_clear_file_hook [code $this clear_file] add_hook file_changed_hook [code $this clear_file] + global Colors + set Colors(change) [pref get gdb/src/PC_TAG] + update dummy } @@ -45,6 +48,16 @@ cursor watch } + # ------------------------------------------------------------------ + # PUBLIC METHOD: reconfig - used when preferences change + # ------------------------------------------------------------------ + method reconfig {} { + debug + global Colors + set Colors(change) [pref get gdb/src/PC_TAG] + $tree update + } + # Re-enable the UI method idle {event} { debug diff -ruN gdbtk_orig/library/prefs.tcl gdbtk/library/prefs.tcl --- gdbtk_orig/library/prefs.tcl 2008-03-04 00:25:03.000000000 +0100 +++ gdbtk/library/prefs.tcl 2012-03-22 10:01:08.631451500 +0100 @@ -338,7 +338,7 @@ pref define gdb/console/font global/fixed # Source window defaults - pref define gdb/src/PC_TAG green + pref define gdb/src/PC_TAG \#00b300 pref define gdb/src/STACK_TAG gold pref define gdb/src/BROWSE_TAG \#9595e2 pref define gdb/src/handlebg red @@ -719,11 +719,6 @@ proc pref_set_option_db {makebg} { global Colors - # The color of text that indicates changed items - # We standardize on one color here so that changed - # items don't blend into any OS color scheme - set Colors(change) "green" - option add *background $Colors(bg) option add *buttonBackground $Colors(bg) option add *Text*background $Colors(textbg) diff -ruN gdbtk_orig/library/srcpref.itb gdbtk/library/srcpref.itb --- gdbtk_orig/library/srcpref.itb 2008-08-03 00:08:32.000000000 +0200 +++ gdbtk/library/srcpref.itb 2012-03-21 16:29:42.639519400 +0100 @@ -54,7 +54,7 @@ set w [$f.colors get_frame] set color [pref get gdb/src/PC_TAG] - label $w.pcl -text {PC} + label $w.pcl -text {PC/Var change} button $w.pcb -text { } -activebackground $color -bg $color \ -command [code $this _pick $color $w.pcb PC_TAG] diff -ruN gdbtk_orig/library/vartree.itb gdbtk/library/vartree.itb --- gdbtk_orig/library/vartree.itb 2012-01-03 13:27:01.000000000 +0100 +++ gdbtk/library/vartree.itb 2012-03-21 15:36:04.871794200 +0100 @@ -135,7 +135,7 @@ if {[catch {$var value} value]} { set color $colors(error) } elseif {[$c itemcget $val -text] != $value} { - set color $colors(change) + set color $::Colors(change) } else { set color $colors(value) } @@ -404,7 +404,6 @@ set colors(type) "red" set colors(error) "red" set colors(value) "black" - set colors(change) $::Colors(change) set colors(disabled) "gray50" set colors(line) "gray50" --------------070608080305030202080505--