Commit Graph

15532 Commits

Author SHA1 Message Date
Cosimo Cecchi
69a5b3af94 menuitem: cleanup arrow-spacing fetch code
Refactor get_arrow_size() to return the spacing as well, since basically
we always need both.
2011-12-15 18:52:30 +01:00
Cosimo Cecchi
05e62e0251 menuitem: share code between HFW and non-HFW height requests
The code is very similar; having two slightly different code paths is
bad and can lead to bugs. Refactor the code to use the same height
request function.
2011-12-15 18:52:30 +01:00
Cosimo Cecchi
4d76b10ce5 menuitem: properly respect padding when drawing the separators
Use the padding when calculating the draw coordinates of the separator.

https://bugzilla.gnome.org/show_bug.cgi?id=666242
2011-12-15 18:52:30 +01:00
Cosimo Cecchi
713df0c72b menuitem: force odd height if we're not using wide separators
So that the 1px line can receive the same amount of space above and
below.

https://bugzilla.gnome.org/show_bug.cgi?id=666242
2011-12-15 18:52:30 +01:00
Cosimo Cecchi
20e94c1275 menuitem: don't request twice the padding for separator menu items
Padding was requested twice for separator menu items.

https://bugzilla.gnome.org/show_bug.cgi?id=666242
2011-12-15 18:52:30 +01:00
Florian Müllner
4f8f8fe828 window: Add hide-titlebar-when-maximized property
For maximized windows, titlebars cannot be used to reposition or
scale the window, so if an application does not use it to convey
useful information (other than the application name), the screen
space occupied by titlebars could be put to better use.
Add a new window property which requests from the window manager
to hide titlebars when windows are maximized to account for this.

https://bugzilla.gnome.org/show_bug.cgi?id=665616
2011-12-15 16:31:56 +01:00
Cosimo Cecchi
cfa0339559 scale: remove unused variable 2011-12-15 12:16:09 +01:00
Rui Matos
1235dc320b widget: Synthesize crossing only if sensitivity changed while propagating state 2011-12-14 17:03:44 +00:00
Andrea Cimitan
40423df234 Add has-origin property for GtkScale
If the scale has an origin (it will have one by default), GtkRange will
render the two sides before/after the current value with different style
classes, making it possible for themes to use different colors and
properties for the two areas.
This was possible in GTK 2 with style details, but got lost during the
road to 3.0.

https://bugzilla.gnome.org/show_bug.cgi?id=665140
2011-12-14 17:16:09 +01:00
Alexander Larsson
10b5ec20f2 Fix set_focus_child handling during focus changes
In many cases we used to set focus_child to NULL all the way up
to the top and then to the right value, even if there was
a common ancestor, meaning these see a temporary NULL value for
focus_child. Only when the new focus widgets direct parent was
in the previous ancestor list did we stop early.

This fixes that by always stopping propagation when reaching
the common ancestor.
2011-12-14 00:26:40 +01:00
Claudio Saavedra
064204da9b GtkFrame: Fix a casting in the compute_child_allocation() method
The casting used to calculate the child allocation is confusing MAX().
As a result, width and height end up with negative values, which makes no sense.

https://bugzilla.gnome.org/show_bug.cgi?id=666109
2011-12-13 20:26:30 +02:00
Cosimo Cecchi
a7f3a9ff74 themingengine: split a GtkThemingBackground object
Allows easier modification and general sanity of the CSS background
rendering code.
2011-12-12 12:46:52 +01:00
Cosimo Cecchi
1e23a74a95 image: take misc padding into account when calculating x/y draw coords
This fixes the misc-alignment.ui reftest.
2011-12-12 12:30:27 +01:00
Cosimo Cecchi
b215aeacc8 image: add gtk_image_get_preferred_size()
Add a function to query the preferred size of the GtkImage, and use it
in the get_preferred_width/height implementations.
2011-12-12 12:29:21 +01:00
Benjamin Otte
92929b968b treeview: Ensure selection's changed signal
There was a corner case where the changed signal was not emitted.
If rows were built like this:
  1    (not selected)
  + 2  (selected)
  + 3  (not selected)
And row 1 was removed, no signal would be emitted.

I like it when writing tests actually finds bugs that have been around
since 2003 - introduced by 4a03ea2334
actually. :)
2011-12-10 08:00:26 +01:00
Benjamin Otte
d4d2cc14d2 treeview: Don't try to optimize away selection_changed signal
We get certain cases, in particular with SELECTION_MULTIPLE, where we
cannot figure out in advance of real_set_cursor() if the selection will
actually change.
2011-12-10 08:00:26 +01:00
Benjamin Otte
559c3c7da1 treeview: Add a CURSOR_INVALID flag to set_cursor_row()
This is necessary so the code doesn't attempt to do things with the
previous cursor, which currently cause crashes.
2011-12-10 08:00:26 +01:00
Benjamin Otte
d3bccfbb6d treeview: Replace lots of boolean args with flags
I want to add more and 3 boolean args is essentially unreadable code.
2011-12-10 08:00:26 +01:00
Benjamin Otte
4dbedb7481 docs: Update code demo for newer glib 2011-12-10 08:00:26 +01:00
Benjamin Otte
1a2932ba29 treeview: Handle the case where the cursor row gets deleted
Previously, the cursor would just become invalid, which used to
reselect the first row in the treeview later on (without a
cursor-changed signal). This leads to a crash now with the recent
refactorings.

The patch is longer than I'd like it to be, but the situation is kinda
complicated, because we want to make sure to move the cursor to a good
row. It works like this:
1) From the deleted row, search forward for the first row that is not
   going to be deleted and is not a separator.
2) If no such row exists, search backwards for a row that is not a
   separator.
3) If no such node exists, clear the cursor.
2011-12-10 08:00:26 +01:00
Benjamin Otte
e01af5c5c9 treeview: Replace cursor handling by keeping the node
Previously the code used a GtkTreeRowReference, which was (a) less
performant and more importantly (b) hiding errors.
The errors being hidden were the referenced row becoming invalid or
collapsed, because such rows would not be valid cursor rows and it would
be necesary to select a new row and emit a "cursor-changed" signal.

So if a crash bisects down to this commit, it is very likely that the
cursor has not correctly been updated and the cursor row is invalid.
2011-12-10 08:00:26 +01:00
Benjamin Otte
78aad2d35c treeview: Use _gtk_rbtree_contains() in a11y code 2011-12-10 08:00:25 +01:00
Benjamin Otte
710a8435cc rbtree: Add _gtk_rbtree_contains()
It's useful in a bunch of places, so split it out
2011-12-10 08:00:25 +01:00
Matthias Clasen
9bf17a95e5 Revert 3fd7dbc940
Calling gdk_keymap_add_virtual_modifiers causes _all_ virtual
modifiers to be added, which causes problem when they are co-located
on the same real modifier (as Super and Hyper often are). Effectively,
this made it impossible to enter key combinations involving Super,
since they all turn into Super+Hyper.
2011-12-08 12:44:19 -05:00
Timothy Arceri
36effbb307 print to file: fixed lost filename in gui
Stop widget creating an event before updating both directory and
filename values.

https://bugzilla.gnome.org/show_bug.cgi?id=603823
2011-12-07 20:04:38 -05:00
Benjamin Otte
6454c718dd overlay: Properly allocate the child upon addition
This ensures that after addition the child gets assigned the proper
allocation and the child window is properly shown/hidden.
2011-12-08 00:24:28 +01:00
Benjamin Otte
003d80dbea overlay: Move code
Move code for child allocation into the child allocation function. Don't
keep it in the overlay allocation code.

See the next commit for why this is useful.
2011-12-08 00:24:28 +01:00
Benjamin Otte
f34d0d6f7b overlay: Create child window before setting parent
Otherwise, the window will not be used when set_parent() maps the child.
2011-12-08 00:24:28 +01:00
Rui Matos
6ed5918718 progressbar: Set state flags on draw
We were missing setting state flags on the style context before drawing.
2011-12-07 22:42:56 +00:00
Rui Matos
7a6babfd02 widget: Unset window-unfocused in gtk_widget_unparent()
Widgets without a parent aren't inside a toplevel window so we must remove
window-unfocused as it doesn't make sense outside a toplevel.

https://bugzilla.gnome.org/show_bug.cgi?id=661428
2011-12-07 22:41:58 +00:00
Benjamin Otte
807a449f29 treeview: Fix crash when scrolling to end
This broke in a4630d0e7b

https://bugzilla.gnome.org/show_bug.cgi?id=665741
2011-12-07 20:12:12 +01:00
Benjamin Otte
c24742e789 modifierstyle: Fix compile errors
Introduced in 7bd2446801
2011-12-06 18:01:57 +01:00
Alexander Larsson
7bd2446801 Remove broken optimization in style modifier overrides
We used to only set the override color or font if it was different
than the existing value. However, that means you can't change it to
an override that is the same as the default value for the property.

With this fixed you can e.g. override with a color of 0,0,0,0 which
you couldn't before.
2011-12-06 14:12:23 +01:00
Matthias Clasen
d978ed85ae Remove an unused variable 2011-12-05 18:07:41 -05:00
Carlos Garnacho
029a884d9e gtk,notebook: Invalidate the gap side when reordering tabs
This narrow area is invalidated so the gap follows the tab
being reordered.
2011-12-05 21:23:23 +01:00
Alexander Larsson
fd06890354 notebook: Make the tab reordering dnd window transparent 2011-12-05 21:15:06 +01:00
Cosimo Cecchi
392cdff697 statusicon: fix the build on !X11
Uninevitable fallout from my last patch to GtkStatusIcon. Thanks to Rob
Bradford for testing this.
2011-12-05 13:22:20 -05:00
Benjamin Otte
4259a27cf5 widget: Update Pango context on state change
The layout depends on the state flags, so it must be updated when they
change.
2011-12-05 18:27:05 +01:00
Benjamin Otte
c3cccf586c label: Clear layout on state change
Selected or active text might be rendered differently.
2011-12-05 18:27:05 +01:00
Benjamin Otte
5ac6950dd6 label: Move callback to new stuff
We want to react to state flags changing, not to the (deprecated) state
type changing.
2011-12-05 18:27:05 +01:00
Cosimo Cecchi
d80ff7b5f1 stylecontext: always add the ARROW style class when rendering an arrow
When gtk_render_arrow() is called, always add an ARROW style class to
the GtkStyleContext before rendering, so themes can specify a different
color for it.

https://bugzilla.gnome.org/show_bug.cgi?id=665420
2011-12-05 09:37:21 -05:00
Cosimo Cecchi
c538fb8f64 stylecontext: add GTK_STYLE_CLASS_ARROW
For e.g. submenu items arrow in GtkMenuItems.

https://bugzilla.gnome.org/show_bug.cgi?id=665420
2011-12-05 09:30:57 -05:00
Cosimo Cecchi
2e01dc1b7a statusicon: port to GtkIconHelper
Just always render the pixbuf ourselves and set it on the GtkImage in
the X11 case.
Code for other backends was already rendering the pixbuf manually before
translating it into a native type, so this greatly simplifies the code.

https://bugzilla.gnome.org/show_bug.cgi?id=665409
2011-12-05 09:09:43 -05:00
Alexander Larsson
c47ef89aca Merge branch 'transparent-windows' 2011-12-05 14:24:28 +01:00
Alexander Larsson
93c086ec80 Make window handle transparent
Instead of painting the window background on the grip_window we now
only paint it on the GtkWindow->window, and we make the grip_window
have a transparent background.

We can't really make transparent window handle background optional
via css atm, because the handle color is actually based on the
background color, so if that is set to transparent we won't draw
anything.
2011-12-05 12:51:55 +01:00
Cosimo Cecchi
2bf765ab49 entry: avoid a mismatched cairo_save/restore
Leftover from GtkIconHelper migration.
2011-12-04 19:58:28 -05:00
Paolo Borelli
5a471fefdb Remove unused alignment from GtkTooltip. 2011-12-04 19:20:23 +01:00
Paolo Borelli
7c779a0bee Plug tiny leak in the css parser 2011-12-03 17:52:24 +01:00
Claudio Saavedra
f9c24e8f03 GtkIconView: fix a memory corruption in the drag-n-drop code
You shall free with g_slice_free() what you allocate with
g_slice_new().

https://bugzilla.gnome.org/show_bug.cgi?id=665338
2011-12-01 22:56:43 +01:00
Cosimo Cecchi
58b1f24d6d image: use the default icon size if no icon size is provided
If no icon size is provided (e.g. when setting icon-name or stock-id
using the GObject property directly), use the default icon size. This
matches the previous GtkImage behavior.
2011-11-30 19:47:52 -05:00