[Bugs] #4056 Write UNSP: Write. text selection have fg & bg black

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Thu Oct 18 16:56:20 EDT 2012


#4056: Write. text selection have fg & bg black
------------------------------------------+---------------------------------
    Reporter:  godiard                    |          Owner:  godiard    
        Type:  defect                     |         Status:  new        
    Priority:  Unspecified by Maintainer  |      Milestone:  0.98       
   Component:  Write                      |        Version:  Unspecified
    Severity:  Unspecified                |       Keywords:             
Distribution:  Unspecified                |   Status_field:  Unconfirmed
------------------------------------------+---------------------------------

Comment(by godiard):

 Tried different options:

 * Set the color in the css, as:
 {{{
 AbiWidget *:selected {
    background-color: @selection_grey;
 }
 }}}
 * Override the color in the activity:
 {{{
 diff --git a/AbiWordActivity.py b/AbiWordActivity.py
 index 2dff90b..f594709 100644
 --- a/AbiWordActivity.py
 +++ b/AbiWordActivity.py
 @@ -25,6 +25,7 @@ from gi.repository import GObject
  GObject.threads_init()

  from gi.repository import Gtk
 +from gi.repository import Gdk
  from gi.repository import Abi
  from gi.repository import GdkPixbuf
  import telepathy
 @@ -215,6 +216,15 @@ class AbiWordActivity(activity.Activity):
              self.abiword_canvas.set_font_name('Sans')
          self.abiword_canvas.moveto_bod()

 +        # set selection color
 +        selection_color = style.Color('#A6A6A6')
 +        rgba = Gdk.RGBA()
 +        rgba.red, rgba.green, rgba.blue, rgba.alpha = \
 +
 selection_color.get_rgba()
 +        logging.error('set selection bacground %s', rgba)
 +
 self.abiword_canvas.override_background_color(Gtk.StateFlags.SELECTED,
 +                rgba)
 +
      def get_preview(self):
          if not hasattr(self.abiword_canvas, 'render_page_to_image'):
              return activity.Activity.get_preview(self)
 }}}

 I think the code relevant in abiword is in wp/ap/gtk/ap_UnixFrameImpl.cpp
 method AP_UnixFrameImpl::getColorSelBackground

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/4056#comment:2>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list