It doesn't make sense to keep them separate as GtkSizeRequest requires a
GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have
one without the other.
It also makes the code a lot easier because no casts are required when
calling functions.
Also, the names would translate to gtk_widget_get_width() and people
agreed that this would be a too generic name, so a "preferred" was added
to the names.
So this patch moves the functions:
gtk_size_request_get_request_mode() => gtk_widget_get_request_mode()
gtk_size_request_get_width() => gtk_widget_get_preferred_width()
gtk_size_request_get_height() => gtk_widget_get_preferred_height()
gtk_size_request_get_size() => gtk_widget_get_preferred_size()
gtk_size_request_get_width_for_height() =>
gtk_widget_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
gtk_widget_get_preferred_height_for_width()
... and moves the corresponding vfuncs to the GtkWidgetClass.
The patch also renames the implementations of the vfuncs in widgets to
include the word "preferrred".
Since we have a new mechanism for requesting sizes: GtkSizeRequestIface;
it makes no sense to maintain this cache on the GtkWidget structure...
removing the requisition cache however does not break the old "size-request"
signal which is there for backwards compatability reasons.
In any case widget->requisition should not have been accessed,
gtk_widget_get_child_requisition() would have been the correct way
to consult the cache.
This commit also deprecates the newly added gtk_widget_get_requisition()
API and makes it fallback on gtk_size_request_get_size().
Ellipsize labels in the Save folder's combo so they don't grow too wide.
Ellipsize labels in normal directory buttons in the pathbar, and make
their requisition's width reasonably small. Use a tooltip for buttons
that got ellipsized.
Instead of placing the down-slider directly beside the last button in
the pathbar, use the remaining space in the pathbar for the last
button. Use a different method to find the first visible button.
Walk down from the end, adding buttons until we use all free space.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2008-08-12 Michael Natterer <mitch@imendio.com>
* gtk/*.c: consistently chain up using
GTK_FOO_CLASS(parent_class)->bar(instance) instead of
(*GTK_FOO_CLASS(parent_class))->bar(instance).
svn path=/trunk/; revision=21085
2008-06-10 Carlos Garnacho <carlos@imendio.com>
Bug 520874 - Should use gio directly.
* gtk/gtkfilesystem.[ch]: Turn into a private object, which mostly
provides helper functions for asynchronous calls, folder abstraction
and uniform handling of volumes/drives/mounts.
* gtk/gtkfilesystemwin32.[ch]:
* gtk/gtkfilesystemunix.[ch]: Removed, these are no longer required.
* gtk/gtkfilechooser.c:
* gtk/gtkfilechooserbutton.c:
* gtk/gtkfilechooserdefault.c:
* gtk/gtkfilechooserentry.[ch]:
* gtk/gtkfilechooserprivate.h:
* gtk/gtkfilechooserutils.c:
* gtk/gtkfilesystemmodel.[ch]:
* gtk/gtkpathbar.[ch]: Use GIO internally. Adapt to GtkFileSystem API.
Do not load filesystem implementation modules.
* gtk/Makefile.am:
* gtk/gtk.symbols: the gtkfilesystem.h private header isn't installed
anymore, nor the unix/win32 implementations.
* README.in: Add blurb about these changes.
svn path=/trunk/; revision=20342
2008-03-03 Carlos Garnacho <carlos@imendio.com>
Fix http://bugzilla.gnome.org/show_bug.cgi?id=417389 - Make the
scrollwheel work in GtkPathBar.
* gtk/gtkpathbar.h (struct _GtkPathBar): New field event_window.
* gtk/gtkpathbar.c (gtk_path_bar_realize): New function. Create
an input-only window, event_window, which we'll use to capture
scroll events.
(gtk_path_bar_map): Show the event_window under the rest of the
windows, so it will be a catch-all for unhandled events.
Signed-off-by: Federico Mena Quintero <federico@gnu.org>
svn path=/trunk/; revision=19699
2007-06-04 Cody Russell <bratsche@gnome.org>
* gtk/gtkpathbar.c (gtk_path_bar_scroll_down): Check
if down_button is NULL. This happens when the pathbar button
for the current directory is too large to fit in the
space, e.g. on Windows for directories named something like
"My Documents and Settings".
svn path=/trunk/; revision=18030
2007-05-16 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkpathbar.c: Add ATK names to the Up, Down, and Root
buttons. Keep the focus from vanishing when Up or Down arrows
become insensitive or invisible. (#357005, Patrick Wade)
svn path=/trunk/; revision=17856
2006-11-08 Carlos Garnacho <carlosg@gnome.org>
* gtk/gtkpathbar.c (on_slider_unmap): added, do not leave the scroll
timeout running if the slider buttons are hidden. (#372527)
2006-09-10 Matthias Clasen <mclasen@redhat.com>
* Commit a patch by Behdad to fix typos, omissions and other
errors in the symbol aliasing, and add checks for local PLT
entries. (#354687, Behdad Esfahbod)
2006-09-04 Kristian Rietveld <kris@imendio.com>
* gtk/gtkpathbar.c (gtk_path_bar_dispose): don't cancel the
operations spawned by buttons here,
(set_button_image_get_info_cb): bail out if button is NULL, but
do free button_data,
(button_data_free): only free the data is non NULL (since this
function can be called multiple times for the same data), cancel
handle is pending but don't free button_data in this case (will
happen in the callback).
2006-05-16 Kristian Rietveld <kris@imendio.com>
* gtk/gtkpathbar.c (gtk_path_bar_dispose): cancel all pending handles
in the button list. (Fixes#341035, reported by William Jon McCann).
2006-05-03 Federico Mena Quintero <federico@novell.com>
Merged the federico-filename-entry branch, to fix bug #136541.
Combined ChangeLogs:
2006-04-17 Federico Mena Quintero <federico@novell.com>
* gtk/gtkfilechooserdefault.c (pending_select_paths_process):
Oops, we *do* need to check that we are in OPEN mode before
selecting the first row in the file list. See
https://bugzilla.novell.com/show_bug.cgi?id=166906
(gtk_file_chooser_default_get_paths): If we are in the case for
the file list, and the list has no selected rows, jump to the case
for the filename entry. This is so that
1. The user types a filename in the SAVE filename entry
("foo.txt").
2. He then double-clicks on a folder ("bar") in the file
list.
will yield the expected "bar/foo.txt" selection.
2006-03-29 Federico Mena Quintero <federico@novell.com>
* gtk/gtkpathbar.c (gtk_path_bar_init): Reduce the inter-button
spacing to 0.
* gtk/gtkfilechooserdefault.c (browse_widgets_create): Make the
location label bold.
2006-03-29 Federico Mena Quintero <federico@novell.com>
* gtk/gtkfilechooserdefault.c (location_mode_set): Just change the
location_mode field if we are in SAVE/CREATE_FOLDER modes.
(gtk_file_chooser_default_get_paths): Get the path based on the
currently focused widget, or the last-focused widget. This is
what we should have been doing in the beginning, but it worked out
fine because we didn't have the possibility of a filename entry in
OPEN mode.
(gtk_file_chooser_default_should_respond): Handle the case where
the last focused widget is the location_entry.
2006-03-28 Federico Mena Quintero <federico@novell.com>
* gtk/gtkfilechoosersettings.[ch]: New files with a simple
framework for saving/loading settings from the file chooser in
$XDG_CONFIG_HOME/gtk-2.0/gtkfilechooser.
* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_unmap):
Save the current settings.
(settings_save): New helper function. We save the location_mode
and show_hidden flags.
(gtk_file_chooser_default_map): Load the settings.
(settings_load): New helper function.
* gtk/gtkfilechooserentry.c
(_gtk_file_chooser_entry_set_file_part): Oops, don't modify
in_change. Our handlers are what set the file_part, so they
*must* be run when we modify the text.
2006-03-27 Federico Mena Quintero <federico@novell.com>
* gtk/gtkfilechooserprivate.h (struct _GtkFileChooserDefault):
Removed the save_file_name_entry. We'll make this be the same as
the location_entry widget.
(struct _GtkFileChooserDefault): Leave only location_button,
location_entry_box, location_label, location_entry. We'll use a
single toggle button for the location entry, which will appear
below the path bar.
(struct _GtkFileChooserDefault): Added a
processing_pending_selections flag.
* gtk/gtkfilechooserdefault.c (save_widgets_create): Destroy the
old location_entry if necessary, and hide the location toggle
widgets.
(update_chooser_entry): In multiple selection mode, just clear the
location_entry.
(check_save_entry): Allow running in OPEN or SELECT_FOLDER modes
if we are in LOCATION_MODE_FILENAME_ENTRY.
(gtk_file_chooser_default_should_respond): Switch to a folder if
the location_entry contains a folder name in OPEN and SAVE mode,
not just SAVE mode. If the entry doesn't contain a folder name,
but is otherwise well-formed, and we are in OPEN mode, return that
we should respond with that filename.
(gtk_file_chooser_default_initial_focus): Focus the location_entry
if appropriate.
(browse_widgets_create): Create the location_entry_box and the
location_label here.
(update_appearance): Call location_mode_set() when switching back
to OPEN/SELECT_FOLDER mode. Hide the location_button when
switching to SAVE/CREATE_FOLDER mode.
(pending_select_paths_process): Turn the
processing_pending_selections flag on and off around changes to
the current selection. Don't special-case OPEN mode anymore,
since the new flag will take care of things in
update_chooser_entry().
(update_chooser_entry): Don't do anything if
processing_pending_selections is TRUE. This keeps the entry from
being polluted when changing folders.
(location_popup_handler): In OPEN/SELECT_FOLDER modes, toggle
between the path bar and the entry. In SAVE/CREATE_FOLDER modes, simply focus the
location_entry.
(update_from_entry): Removed.
(location_entry_create): Removed.
(open_location_cb): Removed.
(file_list_build_popup_menu): Don't add an "Open _Location" menu item.
(location_entry_set_initial_text): Don't do anything if
current_folder is NULL.
* gtk/gtkfilechooserentry.c
(_gtk_file_chooser_entry_set_file_part): Turn in_change on and off
around the call to gtk_entry_set_text(). This makes completion
not happen when the caller has explicitly set a name.
2006-03-24 Federico Mena Quintero <federico@novell.com>
* gtk/gtkfilechooserprivate.h (struct _GtkFileChooserDefault):
Added fields location_mode_box, location_pathbar_radio,
location_filename_radio, location_widget_box, location_label,
location_entry. The radio buttons will switch between the pathbar
and the location entry; the other boxes are for layout purposes.
(enum LocationMode): New enum.
(struct _GtkFileChooserDefault): Added a location_mode field.
* gtk/gtkfilechooserdefault.c (browse_widgets_create): Create the
location radio buttons to switch between the pathbar and the
location entry. Pack the browse_path_bar in the new
location_widget_box instead of a generic hbox.
(location_buttons_create): New function.
(gtk_file_chooser_default_init): Initialize impl->location_mode.
(location_switch_to_path_bar): New function.
(location_switch_to_filename_entry): New function.
* gtk/gtkfilechooserbutton.c (model_add_special): The display_name
should not be const.