Commit Graph

482 Commits

Author SHA1 Message Date
William Jon McCann
16db6bbccf docs: fix quotes in example 2014-02-06 10:55:12 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
Benjamin Otte
25d02909c8 label: Invalidate link colors on style change
Discovered-by: Timm Bäder <mail@baedert.org>

https://bugzilla.gnome.org/show_bug.cgi?id=721309
2014-02-05 13:38:54 +01:00
Benjamin Otte
219357d69c label: refactor code
Split out function for setting attributes. This will be needed in future
patches.
2014-02-05 13:38:54 +01:00
Benjamin Otte
a0bfbc8ae1 label: Avoid creating new attribute list
Only create an attribute list for merging if we actually need to merge.

This bug was introduced in 5230cfe805
2014-02-05 13:38:54 +01:00
William Jon McCann
3b3d8ca456 docs: Use "#" for refsect2 instead of ## 2014-02-04 21:00:58 -05:00
William Jon McCann
a22358c0c0 docs: use ` instead of <literal> 2014-02-04 18:24:29 -05:00
William Jon McCann
76447c3512 docs: use quotes instead of <firstterm> 2014-02-04 18:10:11 -05:00
William Jon McCann
6ba5e6bb1a docs: don't use <tag> docbook elements 2014-02-04 17:38:09 -05:00
William Jon McCann
dcd43cc77a docs: fix spurious list close tag
Missed by patch 30cc1512e
2014-02-03 09:51:40 -05:00
Matthias Clasen
245c385ae7 Docs: Don't use note elements
In most cases, the text itself makes the message clear enough.
2014-02-02 01:22:14 -05:00
Matthias Clasen
30cc1512e6 Docs: Use markdown for lists
This greatly reduces the amount of xml in the docs.
2014-02-02 01:07:39 -05:00
Matthias Clasen
09d1b28249 docs: Convert to markdown
Specifically, switch to using markdown syntax for sections.
2014-02-02 00:30:27 -05:00
William Jon McCann
4c8bd8e7cf docs: Identify examples that are C code
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
768bc44081 docs: use |[ ]| instead of <programlisting></programlisting>
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
8e421623e6 docs: don't use properties syntax for child props 2014-01-21 18:57:37 -05:00
Matthias Clasen
b85a8001e0 GtkLabelAccessible: update state of links
This commit makes the LinkImpl children of label accessibles
inherit all their state, except for focused and visited, which
are handled directly.

https://bugzilla.gnome.org/show_bug.cgi?id=721406
2014-01-04 10:54:03 -05:00
Matthias Clasen
5845356d66 GtkLabelAccessible: Implement AtkHypertext
This commit makes the label accessible implement AtkHypertext,
which returns a AtkHyperlink object for each link in the text.
At the same time, add AtkHyperlinkImpl objects as children
to the label accessible.

Also some private API to indicate that links have changed, and
call that from GtkLabel when needed.

Adjust expected output of the affected a11y tests.

https://bugzilla.gnome.org/show_bug.cgi?id=721410
https://bugzilla.gnome.org/show_bug.cgi?id=721421
2014-01-04 10:54:03 -05:00
Matthias Clasen
0d9efde303 GtkLabel: Add private api for links
This exposes enough information to implement the AtkHyperText
interface.

More private link api
2014-01-04 10:54:03 -05:00
Matthias Clasen
c6d9f82916 Add a gtklabelprivate.h header
For now, move the few private functions from gtklabel.h here.
2014-01-04 10:54:03 -05:00
Timm Bäder
5201c876d5 GtkLabel: Use :visited and :link for link colors
https://bugzilla.gnome.org/show_bug.cgi?id=709629
2013-11-04 16:36:11 +01:00
Stefan Sauer
d4679c0a13 frame: annotate the @label params with (allow-none) 2013-08-29 09:06:31 +02:00
Benjamin Otte
4787a1ac61 label: Initialize lines value to -1
Fixes defaultvalue test.
2013-08-23 18:27:12 +02:00
Benjamin Otte
64a1f30468 label: Fix gcc warning 2013-08-23 18:24:20 +02:00
Matthias Clasen
eab0ff8e4e Add api to ellipsize labels to multiple lines
When setting the lines property, the label will be ellipsized
to that many lines, with the ellipsis only appearing in the
last line. This is different from how ellipsization of multi-line
labels normally works in GTK+.
2013-08-22 20:38:01 -04:00
Matthias Clasen
624ec0fb7d Add a style class for context menus
Attached widgets inherit from the style of the widget they are
attached to. This can sometimes have unintended consequences,
like a context menu in the main view of gedit inheriting the font
that is configured for documents, or the context menu of the preview
in the font chooser coming up with humongous font size.

To fix this problem, we introduce a context menu style class
and use it for all menus that are used like that. The theme
can then set a font for this style class.

https://bugzilla.gnome.org/show_bug.cgi?id=697127
2013-08-18 13:46:48 -04:00
Jasper St. Pierre
030b62d122 gtkdnd: Introduce a new API for more accurate drag origin data
When trying to drag, we currently the position of the first motion
event to determine where the drag came from. This might be alright
in the case of the old animation, but the data will be inaccurate
if the user has moved the pointer quite a bit since pressing the
cursor to start dragging. While we could monkey patch the GdkEvent
at the widget layer, this is unintuitive and strange.

Add a new API that takes a set of pointer coordinates describing
the origin of the drag. Additionally, adapt most widgets to use
it and use it with correct coordinates.

https://bugzilla.gnome.org/show_bug.cgi?id=705605
2013-08-14 07:12:52 -04:00
Matthias Clasen
2f1fa7cdc3 Drop some unnecessary includes
Drop includes of deprecated headers where they are
no longer needed.
2013-07-19 22:32:23 -04:00
Matthias Clasen
0aa57d26b5 Move wholly deprecated classes to gtk/deprecated/
We've recently a number of classes wholly. For these cases,
move the headers and sources to gtk/deprecated/ and adjust
Makefiles and includes accordingly.

Affected classes:
GtkAction
GtkActionGroup
GtkActivatable
GtkIconFactory
GtkImageMenuItem
GtkRadioAction
GtkRecentAction
GtkStock
GtkToggleAction
GtkUIManager
2013-07-19 21:39:47 -04:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
William Jon McCann
7e3a494fac Deprecate and ignore gtk-enable-mnemonics and gtk-auto-mnemonics" properties
They are both enabled by default.
2013-06-26 11:16:12 -04:00
William Jon McCann
02c793f24a Start migrating internals away from GtkStock 2013-06-24 22:20:49 -04:00
Stefan Sauer
a725b06363 label: fix return value type for _draw()
Change from gint to gboolean.
2013-05-08 22:05:56 +02:00
Alexander Larsson
e253a414b0 GtkLabel: Minor cleanup
Make sure we always compare for a set baseline in the same way.
I.e. baseline != -1, never baseline >= 0.
2013-04-23 05:58:08 +02:00
Alexander Larsson
1e1cf89e4f GtkLabel: Support baseline
Report the baseline in get_preferred_height_and_baseline_for_width().
2013-04-23 05:50:37 +02:00
Sébastien Wilmet
30788062f7 GtkLabel: fix underlining of mnemonics
The underscore was shown in front of the mnemonic instead of underlining
it (e.g., _Save).

Thanks to Lars Uebernickel.

https://bugzilla.gnome.org/show_bug.cgi?id=674759
2013-03-24 15:07:40 +01:00
Matthias Clasen
02a0759c5d csd: Make link activation work reliably
The label code was just letting some button press events bubble
up, which caused misbehaviour with the window dragging code.
https://bugzilla.gnome.org/show_bug.cgi?id=695506
2013-03-21 18:07:21 -04:00
Sébastien Wilmet
8e65fa1b43 GtkLabel: fix mnemonic-keyval when use-markup is true
To extract the mnemonic key value, the string must contain the
underscore. But when the "gtk-auto-mnemonics" setting is true and when
the Alt key is not pressed, the underscore must not be displayed. The
problem was that the 'new_str' variable was used for both purposes:
extract the text to display, and extract the accelerator character.

When the underscore must not be visible, the underscores were removed
from the 'new_str' variable before extracting the accelerator character.

Now there are two strings, one for each purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=674759
2013-03-17 16:10:10 -04:00
Benjamin Otte
feb64f40b0 a11y: Emit text-changed signals directly
When setting new text on the label, the text-changed::delete signal
needs to be emitted before deleting the text (so that atk-bridge can
query the old text) while the text-changed::insert event needs to happen
afterwards (for the same reason). The old code using the notify signal
was only emitted after changing the text.
2013-03-15 00:58:29 +01:00
Carl-Anton Ingmarsson
5d011386a6 label: Fix memleak
Caused by recent refactoring in e09957a47d
2013-03-12 20:23:09 +01:00
Benjamin Otte
e09957a47d label: refactor code
If text didn't change, don't change it.

And if that sentence made no sense, that might explain why I refactored.
2013-03-12 12:46:37 +01:00
Alexander Larsson
3d4cd4db3e Add gtk_widget_(un)register_window
This replaces the previously hardcoded calls to gdk_window_set_user_data,
and also lets us track which windows are a part of a widget. Old code
should continue working as is, but new features that require the
windows may not work perfectly.

We need this for the transparent widget support to work, as we need
to specially mark the windows of child widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=687842
2013-02-07 11:11:37 +01:00
Alexander Larsson
bf35c2f044 GtkLabel: Rely on the new pango support for context change tracking
Now that Pango tracks changes to the context automatically there is
no need to do it manually in e.g. style-updated or direction-changed,
in fact the only case we have to care about is when we re-create
the PangoContext due to a screen change, so we only have to clear
the layouts in GtkLabel in screen-changed.

This means we're not clearing all the layouts whenever the state changes,
which happens to every widget when the window is unfocused, which helps
performance a lot.

https://bugzilla.gnome.org/show_bug.cgi?id=340066
2012-12-06 19:54:05 +01:00
Benjamin Otte
7747910b9d gtk: Use context's font
Instead of using gtk_style_context_get_font() in
pango_context_get_metrics(), use pango_context_get_font_description().
The context contains the font description we are about to use after all.
2012-12-06 02:57:18 +01:00
Matthias Clasen
5230cfe805 GtkLabel: Fix a pointless expression
Clearly, what was meant here was that we create a new attribute
list if either of the input attribute lists are non-NULL.
This was found by Coverity.
2012-11-29 23:10:34 -05:00
Benjamin Otte
0d9a45d460 label: Fix another sizing corner case causing segfaults
If the "wider" label is the smaller one, use the wider size for both
cases. This can happen when ellipsizing a single character, which is
often smaller than the ellipsizing glpyph(s).
2012-11-08 23:34:30 +01:00
Benjamin Otte
debe81b1ea label: Handle crazy corner cases
With ellipsizing, the ellipsized text can have a smaller height than the
non-ellipsized text. So the wider text is also higher. Example:
  .<big>TEXT</big>
will ellipsize to the small text.

Reported-By: Rico Tzschichholz <ricotz@t-online.de>
2012-11-05 19:34:23 +01:00
Benjamin Otte
aba0c5cc3b label: Redo get_preferred_width/height()
This is important for size groups mostly, but also has some small fixes.
The label-sizing reftest as been updated accordingly.
2012-11-04 15:28:43 +01:00
Benjamin Otte
f55fe7e20b label: Fix ellipsize and wrap being set
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.
2012-11-04 15:28:43 +01:00
Cosimo Cecchi
f70fc49ebc docs: fix a number of typos and obsolete references 2012-07-02 10:41:11 -04:00