Opened 14 years ago

Closed 14 years ago

#702 closed Enhancement (invalid)

Use a "real" GtkToolbar for Filter Bar

Reported by: LucaFerretti Owned by: charles
Priority: Normal Milestone: None Set
Component: GTK+ Client Version: 1.05
Severity: Normal Keywords:
Cc:

Description

The curren filter bar design is a real no-no for a GTK+ application.

The problem are the filter buttons: usually buttons with labels have the border.

A solution could be use a real toolbar and add buttons as GtkRadioToolButton.

Here is a glade mochup using this approach. IMHO is not so bad.

The "trick" is add a toolbar, populate it with radiobuttons, then add a GtkSeparatorToolItem with "drawn" property set to false and "expand" set to true (to create the space between buttons and text entry), finally add a GtkToolItem and inside it add the entry (well, in the mochup here is a GtkAlignment with right and left border set to 6 pixels).

PS following the direction, could be good convert All/Active/Downloading/?.. to GtkAction and provide a submenu under View menu to apply the filter when the filter bar is hidden.

Attachments (2)

transmission-filter-toolbar-as-real-toolbar.glade (20.2 KB) - added by LucaFerretti 14 years ago.
The glade file with mochup
transmission-filter-toolbar-as-real-toolbar.png (14.9 KB) - added by LucaFerretti 14 years ago.
A screenshot of mochup

Download all attachments as: .zip

Change History (8)

Changed 14 years ago by LucaFerretti

The glade file with mochup

Changed 14 years ago by LucaFerretti

A screenshot of mochup

comment:1 Changed 14 years ago by charles

I don't see what the point of this ticket is. You haven't explained what's "wrong" with the current approach, other than "it's a real no-no".

Transmission doesn't use glade, and your patch loses the hotkeys for the different filter buttons.

comment:2 follow-up: Changed 14 years ago by charles

  • Resolution set to wontfix
  • Status changed from new to closed

I've tried this out in code, and most of it works alright. it's possible to use a placeholder to find where to put the entry field, and that's fine. the expand & homogeneous properties can be set on the radiobuttons so that they don't eat up a lot of space.

unfortunately I can't figure out a way to get mnemonics to work in the toolbar at all!

it also doesn't appear to be able to set the `grow' point when the window is resized horizontally to the area between the buttons and the entry. gtktoolbar appears to defer to the style for deciding on what the maximum expand rate is for any of its child widgets.

Although it would be nice to use the Right Thing, IMO it would be a step backwards here.

comment:3 in reply to: ↑ 2 Changed 14 years ago by LucaFerretti

  • Resolution wontfix deleted
  • Status changed from closed to reopened

Replying to charles:

unfortunately I can't figure out a way to get mnemonics to work in the toolbar at all!

Shotcuts. Toolbar items shouldn't provide a mnemonic (as per HIG), but you can add a shortcut to the action they represent, for example Alt+1 for All, Alt+2 for Active and so on. Alt+NUMBER are also used in nautilus to switch between icon and list view, and in most of the tab based applications (epiphany, gedit, terminal) to change current tab, so they should be coherent with the desktop.

I totally forgot to mention this before.

it also doesn't appear to be able to set the `grow' point when the window is resized horizontally to the area between the buttons and the entry.

In GLADE mochup I've added a GtkSeparatorToolItem with draw=none and expand=true, so this separator is the "growing" widget when you make the window wider. You should be able to do the same in C using something like:

g_object_set_property (separator, "expand", TRUE, NULL);

and also using

gtk_tool_item_set_expand (separator, TRUE)

Or did I misunderstood what you said? Could you post a screenshot showing the issue?

PS sorry for the lag, trac don't send me emails on new comments, so I've to "manually" check for updates...

comment:4 Changed 14 years ago by charles

  • Resolution set to fixed
  • Status changed from reopened to closed

LucaFerretti?: what I'm referring to is the static function get_max_child_expand() in gtktoolbar.c that constrains how much extra space a toolitem can be allocated.

Also I don't see how Alt+1, Alt+2, etc are clearer than real mnemonics that are displayed onscreen.

comment:5 Changed 14 years ago by charles

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:6 Changed 14 years ago by charles

  • Resolution set to invalid
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.