Commit Graph

408 Commits

Author SHA1 Message Date
Rico Tzschichholz
4a43c062ac Fix some implicit declaration warnings
There were some includes of gtkmain.h missing
2011-11-11 13:06:56 +01:00
Michael Natterer
5c4f2ef0c1 gtk: move _gtk_modules_has_mixed_deps() to gtkmodlesprivate.h
and remove gtkmainprivate.h completely.
2011-10-23 13:57:07 +02:00
Javier Jardón
0853ce3077 Use G_VALUE_INIT
Instead of an explicit { 0, } when declaring the variable.
2011-10-15 16:45:16 +01:00
Michael Natterer
2d3db3421f Bug 659406 - Abstract what triggers a context menu
Add gdk_event_triggers_context_menu(), using the new modifier
abstraction API. Remove _gtk_button_event_triggers_context_menu()
and port all callers.
2011-09-27 15:45:18 +02:00
Michael Natterer
b663f3a00b Bug 659406 - Abstract what triggers a context menu
Add _gtk_button_event_triggers_context_menu() and use it instead
of checking for event->button == 3, so context menus are invoked
correctly on the Mac.
2011-09-26 16:01:50 +02:00
Matthias Clasen
dc898e3f84 GtkLabel: make patterns work a little better
When a pattern has been set, we must not throw away
the attributes that contain it.

https://bugzilla.gnome.org/show_bug.cgi?id=658111
2011-09-04 00:01:37 -04:00
Tristan Van Berkom
d7696bd25f Avoid dereferencing NULL pointer in gtk_label_drag_data_get()
It's possible the GtkLabel receives drag'n'drop related signals
if it was setup to receive them by a container or other external
code, just avoid dereferencing priv->select_info in this case.
2011-08-26 19:02:36 +02:00
Chun-wei Fan
ad73ed298d Include C89 fallback code
gtk/gtkborderimage.c, gtk/gtklabel.c and gtk/gtkstyleproperty.c call
round() and/or rint(), which was only available in C99 compilers.

This adds the inclusion of the fallback implementation (gtk/fallback-c89.c)
to define these functions if they are not initially made available by the
compiler.

Also remove the rint() implementation in gtk/gtklabel.c as it is now in
the fallback implmentation.
2011-08-20 11:17:44 +08:00
Matthias Clasen
2ba9c4b4a7 Make focus rectangles optional
This commit introduces a new setting, gtk-visible-focus, backed
by the Gtk/VisibleFocus X setting. Its three values control how
focus rectangles are displayed.

'always' is equivalent to the traditional GTK+ behaviour of always
rendering focus rectangles.

'never' does what it says, and is intended for keyboardless
situations, e.g. tablets.

'automatic' hides focus rectangles initially, until the user
interacts with the keyboard, at which point focus rectangles
become visible.

https://bugzilla.gnome.org/show_bug.cgi?id=649567
2011-08-10 16:34:20 +02:00
Javier Jardon
ad0c0b8eb3 Do not initialize the priv pointer before check type 2011-07-06 14:25:06 +01:00
Matthias Clasen
3e84cc9b17 GtkLabel: optimize away some ::notify emissions 2011-07-05 16:08:09 -04:00
Matthias Clasen
c2d1e3eeb0 Avoid warnings in clipboard code
The a11y selection tests poke the selection on unrealized
labels. Don't spew warnings in this case.
2011-07-05 16:08:08 -04:00
Matthias Clasen
889b2714d5 GtkLabel: factor out two getters
Make the get_property switch look a little nicer.
We export these functions privately for use in the label
accessible implementation later on.
2011-07-05 16:08:07 -04:00
Matthias Clasen
dddf587aec GtkLabel: freeze property notification where appropriate
When setting properties that require recalculating the label
text, freeze notification until the label is properly updated.
This fixes bug 126797.
2011-07-05 16:08:06 -04:00
Matthias Clasen
a381fd288c GailLabel -> GtkLabelAccessible
A first experimental conversion from the gail namespace to gtkaccessible.
At the same time, use gtk_widget_class_set_accessible_type() to register
the accessible type for GtkLabel.
2011-07-05 16:08:06 -04:00
Javier Jardón
bf0d8402f5 gtk: Use const instead G_CONST_RETURN 2011-06-10 13:07:54 +01:00
Matthias Clasen
1371a86fb1 GtkLabel: Make selection behave more similar to GtkEntry
For shift-clicks inside the selection, shrink the selection.
https://bugzilla.gnome.org/show_bug.cgi?id=353712
2011-06-01 01:08:13 -04:00
Javier Jardón
fb9e4c2c37 all: avoid boxed structs copying where possible (and 2)
Use the GtkStyleContext accessors for boxed properties where possible,
to reduce allocations.
2011-05-31 19:18:11 +02:00
Benjamin Otte
03fbb1f34f label: Account for y-translation when rotating 2011-05-22 05:56:11 +02:00
Cosimo Cecchi
c8a59a6f92 all: avoid boxed structs copying where possible
Use the GtkStyleContext accessors for boxed properties where possible,
to reduce allocations.

https://bugzilla.gnome.org/show_bug.cgi?id=650420
2011-05-18 10:27:21 -04:00
Benjamin Otte
33e6479554 label: Compute label offset properly for wrapped justified labels
label offsets were computed wrong for wrapped or ellipsized labels that
were right- or center-justified and had excess space available.
2011-05-05 17:33:44 +02:00
Benjamin Otte
69300df1fc label: Allow using more underline modes 2011-05-03 15:38:43 +02:00
Benjamin Otte
187f91eb90 label: Don't crash when a builder file contains unknown attributes 2011-04-27 00:43:16 +02:00
Benjamin Otte
bf41392861 label: Fix an invariant leading to required > minimum 2011-04-22 02:51:52 +02:00
Benjamin Otte
9bd206a65c label: No need to special case single-line mode
It's already taken care of by the layout.
2011-04-19 22:18:18 +02:00
Benjamin Otte
38676ef718 label: Request more natural size for ellipsizing wrapping labels 2011-04-19 22:18:18 +02:00
Benjamin Otte
484e04aed2 label: Pass the desired height to measuring layout
We always pass -1 for now.
2011-04-19 22:18:18 +02:00
Benjamin Otte
403815f96f label: Remove wrap width leftovers
They're not used anymore, so we can just delete all of this code.
2011-04-19 22:18:18 +02:00
Benjamin Otte
2ecab7b90d label: Set the height of the label when ellipsized or wrapped
Obviously, we want to set it to the label's allocated height.

Also simplifies the size allocation code.
2011-04-19 22:18:18 +02:00
Benjamin Otte
5cb260075e label: Don't use a rectangle variable if we don't use a rectangle 2011-04-19 22:18:18 +02:00
Benjamin Otte
26b2f3127a label: Redo size computation
This gets use closer to the label sizing discussed on the mailing lists.
2011-04-19 22:18:18 +02:00
Benjamin Otte
8e34bff045 label: Set wrap on the layout unconditionally 2011-04-19 22:18:18 +02:00
Benjamin Otte
ffb23fb827 label: Remove duplicated comment 2011-04-19 22:18:18 +02:00
Benjamin Otte
c8ce1106c1 label: Don't try to guess a label's size
People should use window default sizes or label
width-chars/max-width-chars to find the idea layout for a label inside
of relying on magic.
2011-04-19 22:18:18 +02:00
Benjamin Otte
c7cae341a1 label: Don't care about aux info
aux info is something that GtkWidget should do, not any of its
subclasses.
2011-04-19 22:18:18 +02:00
Paolo Borelli
1ad1c33f52 Small cleanup in label sizing code.
Move ellipsized_chars calculation in the scope where it is used.

https://bugzilla.gnome.org/show_bug.cgi?id=647284
2011-04-17 17:23:26 +02:00
Paolo Borelli
af7650ce1f Factor out a get_char_pixels method for clarity.
https://bugzilla.gnome.org/show_bug.cgi?id=647284
2011-04-17 17:16:47 +02:00
Javier Jardón
c1e8577a66 Move documentation to inline comments: GtkLabel 2011-04-15 01:41:13 +01:00
Benjamin Otte
8632ec43eb label: we can't ignore sizes on ellipsized labels
So don't use this optimization when a label is ellipsized.

https://bugzilla.gnome.org/show_bug.cgi?id=646517
2011-04-14 14:59:24 +02:00
Matthias Clasen
8377ecd694 GtkLabelPrivate: Improve struct packing 2011-04-12 12:34:11 -04:00
Benjamin Otte
93b0cecd7e label: Remove dead code
This code has been useless for a while, and now it's breaking things.
Moving the paned in tests/testheightforwidth's wrapping label shows that
bug.

Broken since 9992efdb0e
2011-03-30 13:17:01 +02:00
Benjamin Otte
21f117c695 label: Add another special case for measuring 2011-03-29 15:33:27 +02:00
Benjamin Otte
9992efdb0e label: Don't create the layout in size_allocate() if not needed
Just update its size if it already exists.
2011-03-29 15:33:27 +02:00
Benjamin Otte
c94dca36ca label: Move ellipsized layout width computation
... from size_allocate() to update_layout_width().
2011-03-29 15:33:27 +02:00
Benjamin Otte
bd3e947485 label: Factor out layout size measuring into its own function
Instead of doing half of it in get_preferred_size() and the other half
in get_label_width(), put it all in one place.
2011-03-29 15:33:27 +02:00
Benjamin Otte
e824bb4aab label: Move function to a better location
This patch does not change anything, it just moves the get_label_width
function.
2011-03-29 15:33:27 +02:00
Benjamin Otte
5e80c06d41 label: Factor out layout size setting into a separate function 2011-03-29 15:33:27 +02:00
Benjamin Otte
0930de9446 label: Only get font metrics if we have to
Getting these metrics is expensive, so avoid it if possible.
2011-03-29 15:33:27 +02:00
Benjamin Otte
6ba3ef5d82 label: Add optimization for a common special case
Oftentimes we want to measure a layout that is as wide or wider than the
current layout's maximal width. In that case we can safely reuse the
current layout.
2011-03-29 15:33:27 +02:00
Benjamin Otte
20b90cb793 label: Remove unused boolean argument from ensure_layout()
It's always FALSE.

Note that this patch changes the layout for allocations that are
smaller than 1px, but that's just the default layout that is never
rendered.
2011-03-29 15:33:27 +02:00