Commit Graph

137 Commits

Author SHA1 Message Date
Matthias Clasen
62e9ea412a widget-factory: Remove the menubar 2019-12-29 18:44:26 -05:00
Benjamin Otte
f8a7f30a0d builder: Add GtkBuilderScope
GtkBuilderScope is an interface that provides the scope that a builder
instance operates in.
It creates closures and resolves types. Language bindings are meant to
use this interface to customize the behavior of builder files, in
particular when instantiating templates.

A default implementation for C is provided via GtkBuilderCScope (to keep
with the awkward naming that glib uses for closures). It is derivable on
purpose so that languages or extensions that extend C can use it.

The reftest code in fact does derive GtkBuilderCScope for its own scope
implementation that implements looking up symbols in modules.

gtk-widget-factory was updated to use the new GtkBuilderCScope to add
its custom callback symbols.
So it does it different from gtk-demo, which uses the normal way of
exporting symbols for dlsym() and thereby makes the 2 demos test the 2
ways GtkBuilder uses for looking up symbols.
2019-12-12 19:39:23 +01:00
Benjamin Otte
b025ee428c builder: Connect signals automatically
gtk_builder_connect_signals() is no longer necessary, because all the
setup that made it necessary to have this extra step is now done
automatically via the closure functions.
2019-11-22 17:42:31 +01:00
Benjamin Otte
27d05102ab builder: Remove user_data argument from gtk_builder_connect_signals()
This is pretty unused and gets in the way of the next steps.

A potential side effect is that for templates the widget was passed as
the user data argument. If that turns out to be important, we have to
special case that situation.
2019-11-22 07:46:18 +01:00
Timm Bäder
bcd8941769 widget-factory: Skip xml files in background selection dialog
The default contains a xml file for an animated background, so don't try
loading it as a pixbuf.
2019-10-09 16:57:22 +02:00
Timm Bäder
c3f82534bd widget-factory: Use proper setter to set has-arrow 2019-09-09 17:36:26 +02:00
Timm Bäder
ee27587428 scale: Add a destroy notify to set_format_value_func
Closes #2098
2019-08-15 17:21:47 +02:00
Timm Bäder
ea5fc348fa scale: Replace format-value signal
There is no reason for this to be a signal, since multiple handlers
don't make sense anyway. It was also broken because the scale needs to
know when a signal handler is added so it can update the value
representation.

Replace the signal with a set_format_value_func function which allows us
to do that.

Fixes #113
2019-08-09 14:30:01 +02:00
Timm Bäder
1459ca2c26 widget factory: Plug a memory leak 2019-07-07 07:24:00 +02:00
Daniel Boles
33bd7051f2 widget-factory: Use correct StyleProvider priority
We are an application, not a user.

cherry-pick of !974
2019-07-02 09:09:47 +01:00
Matthias Clasen
fcf92eb6e7 widget-factory: Redo the context menu example
Redo the context menu on the page1 text view in
terms of actions.
2019-06-13 11:59:51 +00:00
Matthias Clasen
f1eb0724bd widget-factory: Move the popover bar to the ui file 2019-06-09 17:38:54 +00:00
Matthias Clasen
3d56a89506 widget-factory: Don't use Return as accel
This is a bad idea, as it interacts badly with
general use of Return for activation.
2019-06-09 17:38:54 +00:00
Matthias Clasen
4d191aa0b5 widget factory: Redo the menubar with a model
No UI change intended, except for the fact that
actions don't do inconsistent states for checks
and radios.
2019-06-09 17:38:54 +00:00
Matthias Clasen
609f1659bd Rationalize popover menu apis
Make gtk_popover_new_from_model() return a GtkPopoverMenu,
rename it to gtk_popover_menu_new_from_model() and add
a relative_to argument to gtk_popover_menu_new().

Update all callers.
2019-06-09 17:38:54 +00:00
Matthias Clasen
0755491b77 widget factory: Add a context menu example
This is also taken from
https://gitlab.gnome.org/Teams/Design/os-mockups/blob/master/menus/menu-design-patterns.png
2019-06-09 17:38:53 +00:00
Matthias Clasen
b4aac42605 widget-factory: Add another popover menu example
This one is taken from
https://gitlab.gnome.org/GNOME/gtk/issues/1824
2019-06-09 17:38:53 +00:00
Benjamin Otte
098f182d8f widget-factory: Show proper separators 2019-06-04 06:11:44 +02:00
Matthias Clasen
7f65e5f96b Rename GtkGestureMultiPress to GtkGestureClick
The name just made it hard for people to find the
right gesture to use.
2019-05-29 17:10:46 +00:00
Matthias Clasen
302d2a04ae Stop using gtk_widget_get_surface
Replace all uses of gtk_widget_get_surface by
gtk_native_get_surface.
2019-05-28 20:25:16 +00:00
Matthias Clasen
e95e39cbd3 widget-factory: Add some animation in a popover 2019-05-24 07:44:21 -04:00
Matthias Clasen
5368f98dd5 demos: Stop using gtk_button_clicked 2019-05-18 14:33:41 -04:00
Matthias Clasen
f4e32f29e1 widget-factory: Update copyright line
Update the years to 2019, and use some better typography.
2019-04-16 18:09:46 -04:00
Matthias Clasen
226e0eadf0 widget-factory: Add an Inspector menu item
Just because we can.
2019-04-16 18:06:12 -04:00
Matthias Clasen
41bb875221 widget-factory: Rename to org.gtk.WidgetFactory4 2019-04-02 00:27:33 +00:00
Benjamin Otte
9d0a42dc14 stack: Add a cube spin transition
Add a transition to GtkStack that pretends pages
are the sides or a cube, and switch them by
rotating the cube.

Use this transition in widget-factory.
2019-03-29 10:03:18 -04:00
Matthias Clasen
9e0c471b03 entry, spin button: Drop redundant API
Avoid duplicating GtkEditable APIs. Port existing users.
2019-02-28 16:34:00 -05:00
Matthias Clasen
131c225598 Merge branch 'wip/jimmac/app-icons' into 'master'
Wip/jimmac/app icons

Closes #1658

See merge request GNOME/gtk!572
2019-02-09 15:09:59 +00:00
Matthias Clasen
ad9c2a624f stack: Convert child properties to a child meta object
Create a GtkStackPage public object which holds the former
child properties of GtkStack.

Adjust all callers.
2019-02-08 00:09:44 -05:00
Jakub Steiner
786322426a app icons: use new style
- update symbolic and fullcolor icons to use the new style
 See https://gitlab.gnome.org/GNOME/Initiatives/issues/2 for more info.

Fixes issue #1658
2019-02-06 16:01:14 +01:00
Emmanuele Bassi
589cb19715 demos: Drop the '+' from GTK
The demos have user-visible text that should refer to "GTK", not "GTK+"
any more.
2019-02-05 10:19:57 +01:00
Timm Bäder
e9e40ddb42 box: Remove gtk_box_pack_start 2019-01-23 19:30:46 -05:00
Benjamin Otte
cbb1e74bb5 textview: Only create cairo context in gtktextdisplay.c
Everything else is done using GtkSnapshot now, including renaming the
draw_layer vfunc to snapshot_layer.
2018-07-14 05:27:54 +02:00
Timm Bäder
2cc6a3ee5c widget factory: Use GtkPicture for background selection
Showing those background images as 16×16 icons doesn't look very nice.
2018-07-08 21:50:59 +02:00
Carlos Garnacho
e08e15ba51 gtkentry: Use gestures for entry icons
Instead of doing all handling manually in the ::event vfunc,
set up drag/multipress gestures on icon images, and implement
emission of ::icon-press/release and DnD there.

As a side effect, the GdkEvent field in ::icon-press/release
signals has been dropped. Callers that might be interested on it
may still use gtk_get_current_event*().
2018-06-21 12:50:57 +02:00
Benjamin Otte
c2ec738a2e widget-factory: Put gesture into ui file 2018-04-26 17:59:41 +02:00
Benjamin Otte
9cecf123f3 widget-factory: Use a pixbuf instead of a surface
This gets rid of the last user of
gdk_cairo_surface_create_from_pixbuf().
2018-04-12 14:03:58 +02: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
Alexander Larsson
391727bd0d GdkWindow -> GdkSurface initial type rename
This renames the GdkWindow class and related classes (impl, backend
subclasses) to surface. Additionally it renames related types:
GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType,
GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge

This is an automatic conversion using the below commands:

git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass

git sed -f g GdkWindow GdkSurface
git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing
git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING
git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2"
git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE
git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo

git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE"
git sed -f g "broadway_window" "broadway_surface"
git sed -f g "BroadwayWindow" "BroadwaySurface"
git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE"
git sed -f g "wayland_window" "wayland_surface"
git sed -f g "WaylandWindow" "WaylandSurface"
git sed -f g "X11_WINDOW" "X11_SURFACE"
git sed -f g "x11_window" "x11_surface"
git sed -f g "X11Window" "X11Surface"
git sed -f g "WIN32_WINDOW" "WIN32_SURFACE"
git sed -f g "win32_window" "win32_surface"
git sed -f g "Win32Window" "Win32Surface"
git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE"
git sed -f g "quartz_window" "quartz_surface"
git sed -f g "QuartzWindow" "QuartzSurface"

git checkout NEWS* po-properties
2018-03-20 11:40:08 +01:00
Matthias Clasen
76b93f5598 widget-factory: Avoid a legacy event handler
We can use a gesture instead, here.
2017-12-12 19:46:10 -05:00
Benjamin Otte
f53848c360 textview: Redo clipboard handling
Instead of using GtkClipboard and handling everything ourselves, we now
put GtkTextBuffer into the GdkClipboard and register (de)serializers for
text/plain.
2017-12-03 05:46:48 +01:00
Benjamin Otte
a59572f96d widget: gtk_widget_get_clipboard => gtk_widget_get_old_clipboard
Just rename the function, so the previous one can be used for the
new clipboard.
2017-12-03 05:46:47 +01:00
Matthias Clasen
4930153413 Finish conversion of pixbuf cell renderer icon size
Change the name of the property from stock-size to icon-size,
and make it an enum property instead of uint. This makes it
impossible to specify invalid numeric values in ui files, and
at the same time makes it possible to refer to the existing
values by their nick.

Fix up the callers.
2017-12-01 10:36:17 -05:00
Matthias Clasen
b9035fc3a6 widget-factory: Fix up icon size handling
Make the icon grid on page 2 work with our new
approach to icon sizes.
2017-12-01 10:29:53 -05:00
Benjamin Otte
9323d098a6 gdk: Cursors no longer have a display
Change constructors to reflect that.

While doing so, also add a fallback argument to the cursor constructors,
so it is now possible to create cursors with fallback.
2017-11-04 00:07:13 +01:00
Benjamin Otte
9151e0b9f5 stylecontext: Port to use display instead of screen 2017-10-31 03:05:54 +01:00
Timm Bäder
9115291515 widget-factory: Don't leak GPropertyAction instances 2017-10-06 16:30:20 +02:00
Timm Bäder
c92b7d4224 box: Remove fill child property
GtkWidget:halign and GtkWidget:valign are sufficient
2017-04-25 20:30:37 +02:00
Timm Bäder
5729ea7744 box: Remove expand child property
GtkWidget already has hexpand/vexpand properties.
2017-04-25 20:30:37 +02:00
Timm Bäder
ea897c6df4 Remove gtk_widget_show_all 2017-01-20 21:37:04 +01:00