summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* sizegroup: Construct the set of sizegroup peers as a hash tableBenjamin Otte2012-11-043-54/+36
| | | | | | | | This way we don't need a marker on GtkWidgetParivate that needs to be unset later, so we have all our data in the same place and can avoid problems with reentrancy and shenanigans like that. But the main reason I wrote that is cleaner code.
* reftests: Add a test from evolutionBenjamin Otte2012-11-043-0/+537
| | | | | | This was used in a bug report. https://bugzilla.gnome.org/show_bug.cgi?id=677609
* reftests: Add a test for all the recent sizegroup hackeryBenjamin Otte2012-11-044-0/+121
|
* sizegroup: Use _gtk_widget_compute_size_for_orientation()Benjamin Otte2012-11-043-74/+26
| | | | | | | | | | With this function now available, we can do size computation in 2 ways: (1) Compute size with size groups (2) Compute size without size groups And have (1) use (2) instead of setting flags on widgets. This patch does exactly that.
* sizerequest: Move optimizationBenjamin Otte2012-11-041-30/+14
| | | | | | With size groups now doing hfw, doing the optimization for CONSTANT_SIZE was done too early. Size groups need to know that it's a hfw request, so the other widgets in the size group get the correct behavior.
* label: Redo get_preferred_width/height()Benjamin Otte2012-11-042-78/+56
| | | | | This is important for size groups mostly, but also has some small fixes. The label-sizing reftest as been updated accordingly.
* label: Fix ellipsize and wrap being setBenjamin Otte2012-11-042-61/+24
| | | | | | | | The label code assumed that Pango treats this as "wrap to as much space as possible and then ellipsize all the lines", but for Pango, ellipsize takes precedence over wrap. So do the same thing in GtkLabel. Also updated is the reftest that checked this behavior.
* reftests: Improve reftest performanceBenjamin Otte2012-11-042-8583/+5511
| | | | | | | | | Get rid of all the event boxes in this test. Event boxes need GDK windows which cost a lot of performance when running the test and they clip the label output. Getting rid of the clipping also shows 2 bugs in this test that weren't visible before. Those will be fixed in a followup patch.
* reftests: Make label-sizing tests use better CSSBenjamin Otte2012-11-041-1/+1
| | | | ow that labels can have backgrounds, just use label backgrounds
* sizerequest: Export _gtk_widget_compute_size_for_orientation()Benjamin Otte2012-11-042-25/+58
| | | | | and add an "ignore_size_groups" flag to it. This way we can use it for size group shenanigans.
* sizegroup: Move GtkSizeGroupMode to gtkenums.hBenjamin Otte2012-11-042-17/+17
| | | | | This is in preparation for the next patch, which would otherwise lead to conflicts.
* sizerequest: Cache sizes without size groupsBenjamin Otte2012-11-041-9/+6
| | | | | | We compute on-demand for size groups anyway, so we can (in theory, this patch doesn't do that yet) get around costly cache blowing when invalidating single widgets of a size group this way.
* sizegroups: Use is_visible() instead of get_mapped() for visibilityBenjamin Otte2012-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The current approach of using gtk_widget_get_mapped() is broken: The usual steps taken when showing a window are: (1) request the sizes (2) allocate the sizes (3) show the window in the allocated size Showing the window with a random size between steps (1) and (2) would of course result in extra work and potential flickering when the widgets get resized to their proper sizes. However, as GtkSizeGroup::ignore-hidden uses gtk_widget_get_mapped() to determine visibility for a widget, the following will happen: (1) the widget will request a 0 size (2) the widget will be allocated a 0 size (3) the widget will be too small when it is shown gtk_widget_get_visible() however is set in advance. Note that toggling visibility also causes a gtk-widget_queue_resize() call already so we take care of changes in here automatically.
* API: Add gtk_widget_is_visible()Benjamin Otte2012-11-044-3/+41
| | | | | This is a recursive gtk_widget_get_visible(): Returns TRUE if the widget and all its parents are visible.
* sizegroup: Handle hfw in size groupsBenjamin Otte2012-11-043-3/+18
|
* sizegroup: Add a function for clarityBenjamin Otte2012-11-041-37/+22
| | | | ... and restructure code to accomodate that function.
* sizegroup: Don't keep groups around everywhereBenjamin Otte2012-11-041-33/+5
| | | | | The code is only interested in the actual widgets that belong together, not in the groups. So just don't return the groups.
* sizegroup: Check ignore_hidden flag when adding groupsBenjamin Otte2012-11-041-31/+20
| | | | | | | Instead of only checking the ignore_hidden flag when getting the preferred sizes, respect it already when constructing the list of widgets. This way, widgets don't queue resizes for groups they're ignored in anyway.
* sizegroup: Use for loopsBenjamin Otte2012-11-041-20/+5
| | | | | | For loops to loop over lists look nicer and actually do the right thing with "break" and "continue" statements. So they are vastly preferred to while loops.
* sizegroups: Restructure codeBenjamin Otte2012-11-041-4/+8
| | | | | This way, we do the checks at the start of the effected function, not before calling it.
* sizegroup: Don't cache the sizes anymoreBenjamin Otte2012-11-041-91/+29
| | | | | | This simplifies code and because sizes are cached by the widgets themselves, it's not a large performance problem (unless people use huge amounts of widgets in a single size group, but who does that?
* Merge branch 'bgo687196-filesystemmodel-crash'Federico Mena Quintero2012-11-023-41/+96
|\
| * bgo#687196 - Fix model corruption during file removalbgo687196-filesystemmodel-crashFederico Mena Quintero2012-11-021-3/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main problem is that we were emitting the row-deleted signal for the model in the middle of the process that actually deletes the row from the model (remove the row from the array, update the model->file_lookup hash table, etc.). In the model's caller, one of the row-deleted callbacks was requesting an iter, which caused the model to revalidate itself - but it did this while it was in an inconsistent state. This led to an assertion failure later when the model resorted itself. The fix in remove_file() is like this: * The filteredness/visibility of the deleted node is not updated. The node will simply be gone; we don't need to update those values at all. * We invalidate just the node that is being deleted. * The model->file_lookup hash table is not completely nuked; instead, we carefully adjust its indices. * The row-deleted signal is only emitted at the very end, when deletion is complete and the model is consistent. Many thanks to William Hua for doing the detective work on this bug! Signed-off-by: Federico Mena Quintero <federico@gnome.org>
| * Make freeze_updates() and thaw_updates() static functionsFederico Mena Quintero2012-11-011-18/+19
| | | | | | | | | | | | They were in the semi-public API of GtkFileSystemModel, but never actually used outside of it. Signed-off-by: Federico Mena Quintero <federico@gnome.org>
| * Comments on how the filtering and sorting processes workFederico Mena Quintero2012-11-012-3/+21
| | | | | | | | Signed-off-by: Federico Mena Quintero <federico@gnome.org>
| * Remove argument to _gtk_file_system_model_update_file() that should not be ↵Federico Mena Quintero2012-10-313-10/+13
| | | | | | | | | | | | part of the internal API Signed-off-by: Federico Mena Quintero <federico@gnome.org>
| * Rename gtk_tree_path_new_from_node() to tree_path_new_from_node()Federico Mena Quintero2012-10-311-7/+7
| | | | | | | | | | | | | | | | | | This is a function internal to the file system model; let's not pollute the gtk_tree_path namespace. Also, make the 'i' variable into 'r' as it refers to a row index, not a file-array index (for consistency with the docs and the rest of the code). Signed-off-by: Federico Mena Quintero <federico@gnome.org>
* | sizegroup: Always at least use widget's sizeBenjamin Otte2012-11-011-5/+7
| | | | | | | | When widgets were hidden, they were otherwise assigned a 0 size.
* | settings: Reset all styles when the enable-animations settings changesBenjamin Otte2012-11-011-0/+3
| | | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=686021
* | Raleigh: Fix spinners with disabled animationsBenjamin Otte2012-11-011-0/+12
| | | | | | | | | | | | | | When animations are disabled, active and inactive spinners should look different. https://bugzilla.gnome.org/show_bug.cgi?id=686021
* | cssimage: Implement some equal functionsBenjamin Otte2012-11-012-0/+42
| |
* | icon-theme: support loading symbolic GFileIcons from generic URIsCosimo Cecchi2012-10-311-36/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | Right now we support loading and recoloring symbolic GFileIcons, but only if the underlying GFile has a local path. This breaks when the GFileIcon is loaded from a GResource, which is a reasonable option for an application that wants to ship a custom symbolic icon. This patch changes GtkIconInfo to store a GFile together with the file path, and changes the symbolic icon lookup code to use the GFile URI, which transparently makes the code work also for GResources. https://bugzilla.gnome.org/show_bug.cgi?id=687059
* | themingbackground: Remove struct membersBenjamin Otte2012-10-312-8/+7
| | | | | | | | ... and put them in the only function they are used in.
* | reftests: Add reftest for fractional border sizesBenjamin Otte2012-10-314-0/+47
| |
* | themingengine: Draw fradctional border sizesBenjamin Otte2012-10-313-100/+80
| |
* | reftests: Fix linear-gradient reftestBenjamin Otte2012-10-311-1/+1
| | | | | | | | ... and add it to the Makefile
* | themingbackground: Remove GtkThemingBackgroundLayerBenjamin Otte2012-10-311-22/+8
| | | | | | | | | | The struct was just the index. So just pass the index around instead of a full struct.
* | themingbackground: Use get_box() for background image sizeBenjamin Otte2012-10-311-45/+10
| |
* | themingbackground: Introduce gtk_theming_background_get_box()Benjamin Otte2012-10-311-36/+22
| | | | | | | | | | to query the different clip boxes used by the background drawing code. Use this function to query these boxes when clipping.
* | themingbackground: Add content_box variableBenjamin Otte2012-10-312-0/+6
| | | | | | | | ... to go with border_box and padding_box.
* | themingbackground: Get rid of flags variableBenjamin Otte2012-10-312-5/+4
| |
* | themingbackground: Move image variableBenjamin Otte2012-10-311-12/+10
| | | | | | | | ... from the Layer struct onto the stack of the only function using it.
* | themingbackground: Restructure code some moreBenjamin Otte2012-10-311-8/+15
| | | | | | | | | | | | Move variable initialization outside the first code with side effects. This allows adding some more early returns, including one for code that used to trigger g_return_if_fail() in certain corner cases.
* | themingbackground: Restructure codeBenjamin Otte2012-10-311-139/+139
| | | | | | | | | | Make if statements encompassing the whole function into early returns. The rest of the diff is reindenting.
* | cssimage: Add a warning for drawing empty imagesBenjamin Otte2012-10-311-0/+2
| | | | | | | | | | width and height of an image must be > 0 for the image to get drawn. It's up to the code further up to ensure that this is not happening.
* | reftests: Add a reftest for recent commitBenjamin Otte2012-10-314-0/+37
| | | | | | | | Check that a computed background-size of 0 is treated as 0.
* | cssvalue: Compute "background-size: 0 0" properlyBenjamin Otte2012-10-311-10/+27
| | | | | | | | Previously a computed value of 0 was treated as "auto", which is wrong.
* | stylecontext: Don't use bg image in gtk_style_context_set_background()Benjamin Otte2012-10-311-10/+0
| | | | | | | | | | | | | | | | | | | | Old code tried to use the "background-image" proeprty for setting the default image background. While this used to work in the early days of GTK3, today it is grossly misleading as the backgronud image may be resized, repositioned and semi-translucent which causes very weird artifacts when rendering. So we use the background-color only instead.
* | cssimage: Add an equal vfuncBenjamin Otte2012-10-313-1/+37
| | | | | | | | No implementations for it exist yet.
* | menuitem: Draw background unconditionallyBenjamin Otte2012-10-311-5/+2
| |