Commit Graph

128 Commits

Author SHA1 Message Date
Matthias Clasen
2a24b8c653 Replace most remaining uses of container api
These are all on GtkBox or enumerating children.
2020-05-11 22:38:21 -04:00
Matthias Clasen
cd0081d08a Use gtk_window_destroy
Replace calls to gtk_widget_destroy on windows
with gtk_window_destroy.
2020-05-11 12:20:57 -04:00
Matthias Clasen
af6e0ee2b3 Use gtk_button_set_child throughout
Replace all uses of gtk_container_add on buttons
by gtk_button_set_child.
2020-05-04 22:53:07 -04:00
Matthias Clasen
6831d3e28e fontbutton: Drop the Private struct 2020-04-13 00:32:50 -04:00
Matthias Clasen
800f1c03d5 Add a GtkFontButton:modal property
Nowadays, dialogs are expected to be attached, typically,
and that only happens when they are marked as modal.
2020-04-13 00:28:34 -04:00
Matthias Clasen
632524f679 Reinstate expected focus behavior
After the :can-focus change in the previous commit, widgets
need to set suitable focus and grab_focus implementations
to implement the desired focus behavior.

This commit does that for all widgets.
2020-04-09 17:50:29 -04:00
Timm Bäder
655711fef2 Rename gtk_widget{get,set,has}_style_class to _css_class
We want to use css instead of style everywhere now.
2020-02-07 13:16:45 -05:00
Timm Bäder
b7ee2cbc28 Start using GtkWidget's new style class API 2020-02-07 13:16:32 -05:00
Timm Bäder
6320bd5849 fontbutton: Shorten clear_font_data a bit 2019-09-13 19:21:02 +02:00
Timm Bäder
86cc7f6925 fontbutton: Use a bin layout 2019-09-13 11:53:24 +02:00
Christian Hergert
f507a79056 marshallers: ensure g_cclosure_marshal_VOID__VOIDv is used
If we set c_marshaller manually, then g_signal_newv() will not setup a
va_marshaller for us. However, if we provide c_marshaller as NULL, it will
setup both the c_marshaller (to g_cclosure_marshal_VOID__VOID) and
va_marshaller (to g_cclosure_marshal_VOID__VOIDv) for us.
2019-05-29 13:22:31 -07:00
Matthias Clasen
7447abb52b Stop using gtk_widget_get_toplevel
All uses of it can be replaced by gtk_widget_get_root.
2019-05-28 20:25:16 +00:00
Matthias Clasen
948347afa9 Stop using gtk_widget_is_toplevel 2019-05-28 20:25:16 +00:00
Matthias Clasen
18788c2a86 Remove gtk_widget_get/set_has_surface
These serve no purpose anymore - widgets don't
have surfaces, unless they're a GtkNative.
2019-05-28 20:25:15 +00:00
Matthias Clasen
e11c1fcb91 font button: Make final 2019-05-28 00:55:28 +00:00
Benjamin Otte
a44ac75e65 gtk: Don't include gtkstylecontext.h from gtkcsstypesprivate.h
And make sure it's included everywhere it's needed.
2019-03-19 08:53:25 +01:00
Bastien Nocera
5a6a7b50af all: Don't warn about deprecated gtk_window_present usage
Avoid compilation warnings about internal users of gtk_window_present().
2019-02-25 17:38:08 +01:00
Timm Bäder
ade171a2ed widget: Don't pass a position to ->size_allocate
The values have been 0/0 for a long time now, so just drop the
GtkAllocation argument and replace it with width and height.
2018-11-13 16:28:54 +01:00
Timm Bäder
a7d8127d59 fontbutton: Remove priv pointer 2018-06-18 17:35:03 +02:00
Mohammed Sadiq
59c8fdff29 font-button: Suggest non deprecated function in docs
gtk_font_button_get_font_name() has been deprecated in 3.22 and
its public API is removed from GTK4.
2018-06-07 15:45:32 +05:30
Benjamin Otte
169203951b widget: Remove clip from size-allocate vfunc
As the clip is no longer needed, get rid of it.
2018-04-05 14:56:38 +02:00
Matthias Clasen
dcdd95bbc8 font button: fix compiler warnings
A PangoLanguage is not a string.
2018-04-05 06:23:14 -04:00
Matthias Clasen
ec66c32def font button: Fix a crash
Since we are now storing the language as a PangoLanguage,
we must not free it anymore.
2018-04-02 17:45:48 -04:00
Matthias Clasen
5a68ac27cf font chooser: Make the language property writable
This is meant as an input to the font chooser.
We don't want the user to select a language, but
rather have fonts presented as they would work for
the current language. Therefore, do away with the
lang/script combo on the tweak page.
2018-04-02 13:37:53 -04:00
Matthias Clasen
17693a2820 font chooser: Align property defaults
Set the default font chooser level to the same value we use
in the backports, to preserve font chooser behavior.
2018-03-31 21:02:51 -04:00
Matthias Clasen
b1b05bee53 font chooser: Make levels flags
Turn the GtkFontChooserLevel field into flags, and
add flags for OpenType variations and features. The
motivation for this is to make font-features in the UI
opt-in, since applications need to support them by
applying the pango attribute.
2018-03-27 16:14:21 -04:00
Matthias Clasen
6ff76a483c font button: notify when ::font-features changes
Lack of notification was causing the font-features to not
show up in the inspector.
2018-03-27 16:14:21 -04:00
Alexander Larsson
63e060a21d GtkWidget: Start renaming widget->window
This is an automated change doing these command:

git sed -f g gtk_widget_set_has_window gtk_widget_set_has_surface
git sed -f g gtk_widget_get_has_window gtk_widget_get_has_surface
git sed -f g gtk_widget_set_parent_window gtk_widget_set_parent_surface
git sed -f g gtk_widget_get_parent_window gtk_widget_get_parent_surface
git sed -f g gtk_widget_set_window gtk_widget_set_surface
git sed -f g gtk_widget_get_window gtk_widget_get_surface
git sed -f g gtk_widget_register_window gtk_widget_register_surface
git sed -f g gtk_widget_unregister_window gtk_widget_unregister_surface

git checkout NEWS*
2018-03-20 15:21:12 +01:00
Matthias Clasen
4c150d8eb5 The big versioning cleanup
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
2018-02-06 01:16:32 -05:00
Matthias Clasen
b919c3348f font button: Use GtkWindow::hide-on-close
Instead of the ::delete-event signal.
2018-01-16 14:14:09 -05:00
Matthias Clasen
379970082a font button: Take variations into account
We need to apply variations too, when we are using
the font to render the button label.
2018-01-03 13:07:55 -05:00
Matthias Clasen
894a0c0ff4 font chooser: Add properties for features and language
These can't be returned as part of the font description,
so we need new api for them. For now, this is just readonly
properties. Maybe these should be writable too, eventually.
2018-01-03 12:18:18 -05:00
Matthias Clasen
70bae02612 font button: Remove show-font and show-size
These are now handled in a more systematic fashion
using GtkFontChooserLevel.
2018-01-03 12:18:18 -05:00
Matthias Clasen
f0526359d1 font chooser: introduce font chooser levels
This is a more systematic approach to reducing the
level of detail in the font chooser.
2018-01-03 12:18:18 -05:00
Matthias Clasen
1c3f343baf Remove font-name leftovers
There were still a few places where the font-name
property was used internally.
2017-12-21 12:18:53 -05:00
Matthias Clasen
6ff3222cbd font button: Drop the font-name property
We already have the GtkFontChooser::font property
which serves the same purpose, so get rid of the
duplication.
2017-12-21 11:10:44 -05:00
Matthias Clasen
ffd6baec42 gtk: Intern css names
This avoids a bunch of strdups at startup.
2017-11-17 22:49:57 -05:00
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Timm Bäder
36ab70ddf5 widget: Add baseline and out_clip parameters to size-allocate
Since setting a clip is mandatory for almost all widgets, we can as well
change the size-allocate signature to include a out_clip parameter, just
like GtkCssGadget did. And since we now always propagate baselines, we
might as well pass that one on to size-allocate.

This way we can also make sure to transform the clip returned from
size-allocate to parent-coordinates, i.e. the same coordinate space
priv->allocation is in.
2017-07-19 21:27:16 -04:00
Timm Bäder
2cd1a984cf set clip of more widgets 2017-07-19 21:27:11 -04:00
Timm Bäder
aa5f90d9f5 fontbutton: Call the css node "fontbutton"
Otherwise the default looks like a button inside a button.
2017-07-19 21:27:11 -04:00
Timm Bäder
74a51cb5b1 Remove now useless snapshot implementations 2017-07-19 21:27:11 -04:00
Timm Bäder
5c4934cfc0 Chain up in size-allocate implementations
Otherwise we're not setting an allocation at all.
2017-05-01 21:21:40 +02:00
Timm Bäder
dc904ffaf9 gtkfontbutton: hexpand the font label
To restore the previous look.
2017-01-22 14:38:21 +01:00
Timm Bäder
b1408c9694 fontbutton: Be a GtkWidget 2017-01-20 21:51:03 +01:00
Benjamin Otte
dbeeaf7de6 cssprovider: Remove GError out argument from load functions
People should use the GtkCssProvider::parsing-error signal instead.
2016-10-17 16:52:05 +02:00
Matthias Clasen
43312bb8c2 font button: Fix translation of font-name default
The default value should come out of regular translations, not
property translations.
2016-04-25 23:09:19 -04:00
Matthias Clasen
99c2423043 font button: Convert from pango to css properly
This utility function should probably find a home somewhere else.
For now, this makes the deprecation warning go away.
2016-04-18 15:05:24 -04:00
Matthias Clasen
13e5e83798 Add message contexts to translated strings
The string "None" is used in multiple contexts; add message contexts
to give translators a chance to translate them accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=762165
2016-02-16 18:33:16 -05:00
Matthias Clasen
bd456ac67b font button: Add an element name
Give this GtkButton subclass element name button and style class .font.
2015-10-30 17:09:59 -04:00