summaryrefslogtreecommitdiff
path: root/grc
diff options
context:
space:
mode:
authorJosh Blum2011-11-21 22:23:51 -0800
committerJosh Blum2011-11-30 21:27:12 -0500
commitc2bf4895ca65c9c3f7efaf24c64bc8dae5716830 (patch)
treea54f7d692c1c974f9c0e1caab6ca2557bb82331d /grc
parent435dc713e9ea5783729a2205a3c6fb9c9a3380b1 (diff)
downloadgnuradio-c2bf4895ca65c9c3f7efaf24c64bc8dae5716830.tar.gz
gnuradio-c2bf4895ca65c9c3f7efaf24c64bc8dae5716830.tar.bz2
gnuradio-c2bf4895ca65c9c3f7efaf24c64bc8dae5716830.zip
grc: force param text to black to guarantee readability
Diffstat (limited to 'grc')
-rw-r--r--grc/gui/Colors.py3
-rw-r--r--grc/gui/Param.py13
2 files changed, 12 insertions, 4 deletions
diff --git a/grc/gui/Colors.py b/grc/gui/Colors.py
index f0b989b37..c79dadee3 100644
--- a/grc/gui/Colors.py
+++ b/grc/gui/Colors.py
@@ -26,6 +26,9 @@ def get_color(color_code): return _COLORMAP.alloc_color(color_code, True, True)
HIGHLIGHT_COLOR = get_color('#00FFFF')
BORDER_COLOR = get_color('black')
+#param entry boxes
+PARAM_ENTRY_TEXT_COLOR = get_color('black')
+ENTRYENUM_CUSTOM_COLOR = get_color('#EEEEEE')
#flow graph color constants
FLOWGRAPH_BACKGROUND_COLOR = get_color('#FFF9FF')
#block color constants
diff --git a/grc/gui/Param.py b/grc/gui/Param.py
index 7c00c1b67..cb6c663e3 100644
--- a/grc/gui/Param.py
+++ b/grc/gui/Param.py
@@ -1,5 +1,5 @@
"""
-Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+Copyright 2007-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
@@ -22,6 +22,7 @@ from Element import Element
import pygtk
pygtk.require('2.0')
import gtk
+import Colors
class InputParam(gtk.HBox):
"""The base class for an input parameter inside the input parameters dialog."""
@@ -82,7 +83,9 @@ class EntryParam(InputParam):
self._input.connect('changed', self._handle_changed)
self.pack_start(self._input, True)
def get_text(self): return self._input.get_text()
- def set_color(self, color): self._input.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse(color))
+ def set_color(self, color):
+ self._input.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse(color))
+ self._input.modify_text(gtk.STATE_NORMAL, Colors.PARAM_ENTRY_TEXT_COLOR)
def set_tooltip_text(self, text): self._input.set_tooltip_text(text)
class EnumParam(InputParam):
@@ -122,8 +125,10 @@ class EnumEntryParam(InputParam):
def set_color(self, color):
if self._input.get_active() == -1: #custom entry, use color
self._input.get_child().modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse(color))
- else: #from enum, make white background
- self._input.get_child().modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse('#ffffff'))
+ self._input.get_child().modify_text(gtk.STATE_NORMAL, Colors.PARAM_ENTRY_TEXT_COLOR)
+ else: #from enum, make pale background
+ self._input.get_child().modify_base(gtk.STATE_NORMAL, Colors.ENTRYENUM_CUSTOM_COLOR)
+ self._input.get_child().modify_text(gtk.STATE_NORMAL, Colors.PARAM_ENTRY_TEXT_COLOR)
PARAM_MARKUP_TMPL="""\
#set $foreground = $param.is_valid() and 'black' or 'red'