Edit->Ingredients/Description should be scrollable

Bug #663645 reported by Stevie Griffiths
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Recipe Manager
Fix Committed
Undecided
Stevie Griffiths

Bug Description

Make the edit dialogs Ingredients/Descriptions Scrollable.

Tags: help-wanted
Revision history for this message
Stevie Griffiths (kastevie) wrote :
Revision history for this message
Jeff Fortin Tam (kiddo) wrote :

There's a small problem I'm seeing here: if every cell in the listview is editable simply by clicking on it and typing, how can the user select a row (to delete it for example) without selecting individual cell contents?

tags: added: help-wanted
Revision history for this message
Stevie Griffiths (kastevie) wrote :

single click selects the row and cell.
double-click = Edit.

I see one major problem though, a user has to identify that they need to double click to make this editable, it isn't particularly obvious. There may be a setting to always render as a spin, looking at that now.

I think the current way things are done are hugely more identifiable. Maybe the picture I showed is a bug in the theme?

Revision history for this message
Jeff Fortin Tam (kiddo) wrote :

Yes, that's what I'm thinking, this would not be intuitive to mom and pop, unless you put an explanatory label above the listview; but I can't even come up with a simple explanation that could go in that label. Besides, double-clicking all over the place would be hellish.

An alternative could be that 1 click = edit the cell, right-click = select the row and show a popup menu allowing to delete it, but again this would not be intuitive.

I'm starting to think this might be overengineering a solution to a simple problem. Looking back at your original bug description:

> Currently the window gets expanded instead of scrolled.
Then let's just put it in a scrollable area? Note that, in that case, we definitely should remember the window size if the user changes it. I hate apps that force me to resize stuff manually everytime. I implemented that in the main window, but hadn't yet seen a need to do it in the Edit recipe window... (note that for View recipe, that is bug #644485 instead)

> Horizontally layed Widgets don't match heights.
I think this is normal. All apps look like that, I think. It's not like a 2 px height difference is a big deal :)

Revision history for this message
Stevie Griffiths (kastevie) wrote :

Haha, well maybe this is one of those things I tend to notice and pay attention too where the rest of the world doesn't :)

Revision history for this message
Jeff Fortin Tam (kiddo) wrote : Re: [Bug 663645] Re: Ingredients List should be a gtk.ListView

Yeah, I think it's probably more of a bug to be raised in gtk or themes,
as I'm seeing the same "spinbox is smaller than buttons/comboboxes" in
Evolution and Inkscape's prefs...

Revision history for this message
Stevie Griffiths (kastevie) wrote : Re: Ingredients List should be a gtk.ListView

I have been working on a branch that refactors the ingredients list and directions list into widgets dervied from a common class.

It isn't completed (obviously), but it gives an opportunity for you to look at the code I have been writing and see if you are happy with it.

branch is: lp:~kastevie/recipe-manager/refactor-edit-ingredients-directions

Revision history for this message
Stevie Griffiths (kastevie) wrote :

Hey Jeff, I wrote most of the new widgets from scratch and changed a few things as I went along. Can you have a look at the UI modifications and see if you are happy with them?

Revision history for this message
Jeff Fortin Tam (kiddo) wrote :

Hey, haven't inspected the code yet (not my area of expertise anyway ;), but here's some early feedback on the UI.
- The "New ingredient" and "New step" buttons are inside the scrolling area. They should probably be just outside.
- (related): creating a new ingredient/step should auto-scroll to the bottom to focus it
- The scrollbars should only show up when needed (set their visibility to automatic)?
- The multiline text fields in "directions" should have some sort of border. Like gtk.entry's set_inner_border method I think. The main branch has that, it looks ugly without it ;)
- The new ingredient/step buttons have an associated icon in the main branch, is it intentional that they're gone?
- It doesn't yet remember the window size ;)
- Those warning don't happen in the main branch:

(recipemanager:12086): libglade-WARNING **: could not look up stock id 'Import'
(recipemanager:12086): libglade-WARNING **: could not look up stock id 'Export'
(recipemanager:12086): libglade-WARNING **: could not look up stock id 'Print Recipe Book'
(recipemanager:12086): libglade-WARNING **: could not look up stock id 'Edit Recipe'
(recipemanager:12086): libglade-WARNING **: could not look up stock id 'View Recipe'

Revision history for this message
Stevie Griffiths (kastevie) wrote :

Just for the button image, I didn't have one before but added one and found:
"The set_image() method sets the "image" property to the value of image. This property has no effect unless the "gtk-button-images" property is True. See the gtk.Settings reference for more information. Note you do not have to call the gtk.Widget.show() method for image."

The previous button was created by libglade, I am assuming it pushed the label and image into a vbox and put that in the button. options:

-respect gconf settings
-force it by packing the label and image into a vbox and pack that in the button (I think this causes some minor internationalisation issues for right-to-left languages)
-just use the stock image (still respects gconf settings)

summary: - Ingredients List should be a gtk.ListView
+ Edit->Ingredients/Description should be scrollable
description: updated
Revision history for this message
Stevie Griffiths (kastevie) wrote :

I just linked a new branch with a clean commit history / order. I have fixed all the problems you suggested Jeff. Though I can't work out how to get the add item button-image to show without modifying gtk.settings :/

Revision history for this message
Jeff Fortin Tam (kiddo) wrote :

Neat! The biggest remaining problem is that it doesn't automatically scroll down when you click the New ingredient/step button (I'm not sure if it can be done easily, actually)... and that's quite problematic as I know that it's not mom-proof :)

Revision history for this message
Stevie Griffiths (kastevie) wrote :

gah, I thought I added code to do that, but it wasn't scrolling at the right time.
It is a matter of doing things in the right order i.e. add a row, show the row, scroll the scrolled window.

It's not that hard to do, but I am a bit worried that any time I spend on this may be wasted. At the moment I don't know if anyone has had a look at the code part of this / is happy with the direction it is taking.

Revision history for this message
Jeff Fortin Tam (kiddo) wrote :

Looking at your code compared to the main branch, I would be willing to merge it, if you address the scrolling issue in comment #12; unless Daniel has something to say "against" some of your changes/code.

Revision history for this message
Stevie Griffiths (kastevie) wrote :

Scrolling is fixed, it was easier than I thought in the end ^_^.

Revision history for this message
Jeff Fortin Tam (kiddo) wrote :

As there were no objections in the last 3 days, merged to main. Thanks!

Changed in recipe-manager:
assignee: nobody → Stevie Griffiths (kastevie)
status: New → Fix Committed
milestone: none → 0.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.