#1853 SciTE GTK+ 3.20: Selected Find options not highlighted

Bug
closed-fixed
5
2016-09-05
2016-08-19
Chris Mayo
No

SciTE 3.6.6 using GTK+ 3.20.8 on Gentoo Linux

1) Click Search/Find to show Find bar
2) Click on icon for "Match whole word only" or "Case sensitive" etc.

The selected option is not highlighted (e.g. with the sunken effect) shows as before with the focus dotted rectangle (until move focus elsewhere)

Discussion

  • Chris Mayo

    Chris Mayo - 2016-08-19

    Desktop is standard Gnome 3.20 from Gentoo.

     
  • Neil Hodgson

    Neil Hodgson - 2016-08-19
    • labels: --> scite, gtk
    • status: open --> open-accepted
    • assigned_to: Neil Hodgson
     
  • Neil Hodgson

    Neil Hodgson - 2016-08-19

    That's not quite what I'm seeing on Fedora 24 with GTK+ 3.20.8. There, the icons move a little for the sunken appearance but the background and frame aren't drawn in a distinguishing way. These are performed by calls to gtk_render_background and gtk_render_frame on the context which should be a button style (GTK_STYLE_CLASS_BUTTON) to get the right gradients for sunken. There may have been some change in the GTK+ style context or theming subsystem (which has been evolving) that has caused this. context is not null.

    It doesn't appear to be an unusual allocated area (which does appear a bit tight compared to the push butttons) as adding this code just after the gtk_render_frame makes the state visible (but unthemed):

            if (active) {
                cairo_rectangle(cr, 2.5, 2.5, allocation.width-5, allocation.height-5);
                cairo_set_source_rgb(cr, 0.8, 0.8, 0.8);
                cairo_fill(cr);
                cairo_rectangle(cr, 2.5, 2.5, allocation.width-5, allocation.height-5);
                cairo_set_source_rgb(cr, 0.4, 0.4, 0.4);
                cairo_set_line_width(cr, 1);
                cairo_stroke(cr);
            }
    
     
  • Neil Hodgson

    Neil Hodgson - 2016-08-20

    This page talks about changes in 3.20 but isn't really helpful.
    https://developer.gnome.org/gtk3/unstable/ch32s10.html

    What does it mean by "element" names as opposed to "style classes"? The string "element" appears nowhere in the GtkButton documentation.

     
    • Colomban Wendling

      It means that if you want to match a button, with 3.20 ownwards you need to use the button selector rather than the GtkButton one (see GtkButton CSS Nodes for a doc of the nodes and classes).
      Also, many widgets now have virtual internal nodes that can be used to style some parts of a widget.

      However, I'm not very knowledgeable about how you'd mimick a GtkButton with custom render code -- but maybe adding some appropriate style classes could help.

       
  • Colomban Wendling

    Hum, out of curiosity, why isn't WCheckDraw implemented with a GtkToggleButton? (with relief = GTK_RELIEF_NONE)
    The extra button borders could be tuned, instead of customizing the the render of the drawing area itself.

    Further, it could be implemented as:

    GtkToggleButton(relief=GTK_RELIEF_NONE)
    + GtkImage(pixbuf=gdk_pixbuf_new_from_xpm_data(xpmImage))
    

    But maybe I'm missing something, not sure, it just seems a little over-complicated.

     
    • Colomban Wendling

      Proposed GtkToggleButton-based implementation. It doesn't try to shrink the button, but that could be done if wanted.

      (disclaimer: I'm not a real SciTE user, and I only performed naive testing -- but it seems to work fine)

       
      Last edit: Colomban Wendling 2016-08-20
  • Neil Hodgson

    Neil Hodgson - 2016-08-21

    Thanks. That works quite well on GTK+3.20. Named the buttons and added some extra CSS to make them the same size as before:

        gtk_widget_set_name(GTK_WIDGET(button), "toggler");
    
    #toggler {
        padding: 0;
    }
    

    The images are cut off on GTK+ 2.24 but I can #if to the original code there.

     
    • Colomban Wendling

      I'll try and see if it can't be fixed possibly the same as you did for GTK3 using a some gtkrc styling instead of a totally separate implementation. I didn't have time yet, but I'll try and see to this in the next few days.

       
      • Neil Hodgson

        Neil Hodgson - 2016-08-24

        I tried quite a few API approaches and attached gtkparasite to SciTE to manipulate settings. The problem appears to be that space is allocated for the focus rectangle and this leads to either a fat button or cut-off images. Turning the focus rectangle off helped but an indication of focus is worthwhile for the keyboard users.
        The size of the buttons isn't a huge issue but it decreases the space available for the search entry field, particularly on low-resolution displays.

         
        • Colomban Wendling

          I'm not sure what you tried exactly, but attached patch sets a few style details to 0 to make it smaller, and it now has the same size as on GTK3 with your custom style (minus the external margin, but it's the same as other buttons), and still shows the focus. It's less obvious when the button is toggled in, but still visible.

          The images are cut off on GTK+ 2.24 but I can #if to the original code there.

          I don't see this here. When are images cut off?

           
  • Neil Hodgson

    Neil Hodgson - 2016-08-24
    • status: open-accepted --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2016-08-24

    Committed changes from Colomban Wendling but with old code used for GTK+ 2.x as the new code resulted in fat buttons. Changes: [fefd60].

     

    Related

    Commit: [fefd60]

  • Neil Hodgson

    Neil Hodgson - 2016-09-05
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks