Commit Graph

1826 Commits

Author SHA1 Message Date
Matthias Clasen
e9d966488b gtk-demo: Don't overdraw the fishbowl
Set overflow to hidden for the fishbowl widget, so the
blur buttons don't leak out into the window shadow.
2020-05-13 19:21:00 -04:00
Matthias Clasen
e87bc3d33d gtk-demo: Plug a memory leak
This leak was there all along. But with the new
gtk_window_destroy(), it shows up as an unclosable
window. Very noticable.
2020-05-13 17:24:57 -04:00
Alexander Mikhaylenko
3bf6bdae73 demo: Remove double borders from the treeview 2020-05-13 20:57:00 +05:00
Matthias Clasen
ab148c0135 Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

Closes #2740, #2742, and #2741

See merge request GNOME/gtk!1890
2020-05-13 12:08:29 +00:00
Matthias Clasen
10813ddc23 Merge branch 'gtk-demo-expander-fix' into 'master'
gtk-demo: Fix expander demo

See merge request GNOME/gtk!1889
2020-05-13 11:44:11 +00:00
Alexander Larsson
a02c588b19 gtk-demo: InfoBar is not a GtkBox anymore
Use gtk_info_bar_add_child to add children
2020-05-13 11:04:49 +02:00
Alexander Larsson
fede7cd81c gtk-demo: Fix expander demo
GtkExpander is not a GtkBox anymore, so use the new gtk_expander_set_child()
API.
2020-05-13 10:50:41 +02:00
Alexander Larsson
fcbc972c2a print-editor: Fix crash
We're trying to g_free a GFile, which is not good...
2020-05-13 10:18:17 +02:00
Timm Bäder
949eb8d17a node-editor: Monitor file and reload on changes 2020-05-13 08:07:55 +02:00
Matthias Clasen
e7bf4a3de8 tests: Move testcairo into gtk4-demo
Replace the boring checkboard pattern with this
exciting drawing, and save one test binary at the
same time!
2020-05-12 15:43:43 -04:00
Matthias Clasen
694daa1d20 Move print-editor to demos
It is too demo-esque for languishing in tests/.
2020-05-12 15:43:43 -04:00
Emmanuele Bassi
4d09bf3b9b demos: Remove gtk_dialog_run()
Use modal dialogs and the "response" signal.
2020-05-12 13:12:08 +01:00
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
88141103cd Don't use container api on GtkListBox 2020-05-11 22:21:39 -04:00
Matthias Clasen
3bff7d3a37 Stop using container api on GtkFlowBox
GtkContainer is going away.
2020-05-11 22:21:39 -04:00
Matthias Clasen
0d57abfe65 Stop using container api on GtkFixed
GtkContainer is going away.
2020-05-11 22:21:39 -04:00
Matthias Clasen
932aa58237 Avoid container api on grids
GtkContainer is going away.
2020-05-11 22:21:39 -04:00
Matthias Clasen
bc6643f3c2 paned: Redo the api
This commit is porting GtkPaned to be derived
from GtkWidget instead of GtkContainer, while adding
start-child and end-child properties. The existing
properties are renamed to follow the start/end naming
scheme, and we add proper getters and setters.

Update all users.

See #2719
2020-05-11 22:21:33 -04:00
Matthias Clasen
a7abb394e8 Fix a leftover list box child
We were still using container api on a list box child here.
2020-05-11 15:42:52 -04:00
Matthias Clasen
025375ff5f Replace gtk_widget_destroy everywhere
Replace all remaining uses of gtk_widget_destroy
by gtk_container_remove or g_object_unref.
2020-05-11 12:20:59 -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
8f9c3ed44a Stop using gtk_widget_destroyed
Replace all internal use of gtk_widget_destroyed
by g_object_add_weak_pointer.
2020-05-11 12:19:37 -04:00
Matthias Clasen
2415c02bbd Merge branch 'wip/exalm/polish' into 'master'
Random polish

See merge request GNOME/gtk!1850
2020-05-06 21:47:47 +00:00
Matthias Clasen
e09287a109 nodeeditor: Don't use container api on list box rows
GtkListBoxRow is not a container anymore.
2020-05-06 17:03:12 -04:00
Alexander Mikhaylenko
efe21869fb widget-factory: Remove duplicate margin-start 2020-05-07 01:29:33 +05:00
Alexander Mikhaylenko
2f898e8bb9 widget-factory: Align spinbutton in the list on page 2 2020-05-07 01:29:20 +05:00
Matthias Clasen
cad890ee29 gtk-demo: Use GtkDrawingArea::resize
This signal is a replacement for this (ab)use
of ::size-allocate.
2020-05-06 14:27:45 -04:00
Matthias Clasen
84944f1c63 gtk-demo: Use dispose instead of destroy
The destroy vfunc is going away.
2020-05-05 18:25:29 -04:00
Matthias Clasen
0070cff32d widget-factory: Use symboli icons in the toolbar
That is the style that is commonly used nowadays, even
in traditional apps.
2020-05-05 10:45:47 -04:00
Matthias Clasen
88e890c29c widget-factory: Remove unused css
We no longer show the various frame styles.
2020-05-05 10:45:47 -04:00
Matthias Clasen
fa848e94d2 gtk-demo: Port blur demo from GtkBin 2020-05-04 22:53:08 -04:00
Matthias Clasen
ec394e805b Use gtk_combo_box_set_child throughout 2020-05-04 22:53:08 -04:00
Matthias Clasen
77af8e303d Use gtk_overlay_set_child throughout
Replace all uses of gtk_container_add on overlays
by gtk_overlay_set_child.
2020-05-04 22:53:08 -04:00
Matthias Clasen
99ef14b59f Use gtk_search_bar_set_child throughout 2020-05-04 22:53:08 -04:00
Matthias Clasen
12ecbd1508 listboxrow: Derive from GtkWidget
We want to remove GtkBin and GtkContainer as they don't
provide much useful functionality anymore.

See #2681
2020-05-04 22:53:08 -04:00
Matthias Clasen
b8d1a9eb0d flowboxchild: Derive from GtkWidget
We want to remove GtkBin and GtkContainer as they don't
provide much useful functionality anymore.

See #2681
2020-05-04 22:53:08 -04:00
Matthias Clasen
f59f355190 Use gtk_window_set_child throughout
Replace all uses of gtk_container_add on windows
by gtk_window_set_child.
2020-05-04 22:53:08 -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
67759d4c3e Use gtk_scrolled_window_set_child throughout
Replace all uses of gtk_container_add on popovers
by gtk_scrolled_window_set_child.
2020-05-04 22:53:07 -04:00
Matthias Clasen
8e261056b9 Use gtk_popover_set_child throughout
Replace all uses of gtk_container_add on popovers
by gtk_popover_set_child.
2020-05-04 22:53:07 -04:00
Matthias Clasen
71433d01b3 aspect frame use fixup 2020-05-04 17:01:18 -04:00
Matthias Clasen
4a133b4eef fishbow: fixup premature popover 2020-05-04 17:01:18 -04:00
Matthias Clasen
1f63896c6b Use gtk_aspect_frame_set_child throughout
Replace all uses of gtk_container_add on aspect frames
by gtk_aspect_frame_set_child.
2020-05-04 17:01:18 -04:00
Matthias Clasen
1706b80815 Use gtk_frame_set_child throughout
Replace all uses of gtk_container_add for
frames with gtk_frame_set_child.
2020-05-04 17:01:18 -04:00
Matthias Clasen
8bd2043a40 widget-factory: Add .toolbar
We dropped GtkToobar, but we still want to present
something that looks the part here, so add a style
class.
2020-05-04 10:50:34 -04:00
Matthias Clasen
fd1fe0eed5 Merge branch 'matthiasc/for-master' into 'master'
docs: Add more detail to the drawing overview

See merge request GNOME/gtk!1811
2020-05-01 21:09:38 +00:00
Matthias Clasen
e393465fd7 widget-factory: Fix a typo
We wanted to move the conflicting global shortcuts
to the bubble phase, so they don't override the
entry bindings.
2020-05-01 14:24:21 -04:00
Alexander Mikhaylenko
c2e4e1af73 headerbar: Remove user-settable title
Use window title, or custom title widget if it's set. Remove 'title'
property.

Update demos and tests to set the title on the window instead of
headerbar.
2020-05-01 19:48:05 +05:00
Alexander Mikhaylenko
35d50f88c8 headerbar: Remove subtitle
Also remove the box containing title and subtitle, as there's only one
label now.
2020-05-01 19:48:05 +05:00
Alexander Mikhaylenko
43a453e465 headerbar: Remove has-subtitle property
Subtitle will go too in the next commit, but has-subtitle goes first as
it's broken right now anyway.
2020-05-01 19:48:05 +05:00
Matthias Clasen
b1bedbc71a widget-factory: Improve demo keynav
We have example cut/copy/paste actions for which we want
the usual shortcuts to show up in the menus, but they should
not break the expected shortcuts in entries. So, move them
to a capture phase shortcut controller.
2020-04-30 20:08:15 -04:00
Matthias Clasen
f31c85ff99 widget-factory: Add mnemonics to the stack pages 2020-04-30 19:18:09 -04:00
Matthias Clasen
ccb890f065 Use a slightly larger version of the logo animation
This is large enough to not make the media controls
slider shrink to nothing.
2020-04-28 14:00:52 -04:00
Matthias Clasen
80185b0f2a widget-factory: Enable page transitions by default
No need to make this an easter egg.
2020-04-27 14:33:07 -04:00
Matthias Clasen
a3368ab7e9 widget-factory: Revamp transition effects
Use a quick crossfade for the main pages, and use
the rotation for the small stack on page 2, where
it looks less out of place.
2020-04-26 22:30:34 -04:00
Matthias Clasen
1ae898bf0b gtk-demo: Add a shortcuts window
Its not very impressive here, but still good to have.
2020-04-26 22:14:10 -04:00
Matthias Clasen
91c7b24815 icon-browser: Add a gear menu
Add an about dialog, and make the inspector available.
2020-04-26 22:00:18 -04:00
Matthias Clasen
af2903d263 widget-factory: Improve the textview on page 3
Remove an extra frame, make the buttons linked, and
add tooltips.
2020-04-26 21:13:16 -04:00
Matthias Clasen
9ca2a09427 widget-factory: Move the password entry
Move the password entry to the other entries. That
fits the overall organization better, and makes all
the typographical styles fit.
2020-04-26 20:54:09 -04:00
Matthias Clasen
50b930fb1c widget-factory: Make the list on page 2 grow to the bottom
Add a few more items to the list to make it fill up the space.
2020-04-26 20:35:51 -04:00
Matthias Clasen
3ed285ab71 widget-factory: Show typographical style classes
This nicely fills the gap on page 1.
2020-04-26 20:25:11 -04:00
Matthias Clasen
34862dbbb6 gtk-demo: Include pango version in about dialog
This is useful information.
2020-04-26 20:02:10 -04:00
Matthias Clasen
1bdaa99347 widget-factory: Include pango version in about dialog
This is useful information.
2020-04-26 20:01:31 -04:00
Matthias Clasen
ad22c463b8 widget-factory: Add a password entry
Thats a new widget that was missing.
2020-04-26 19:34:36 -04:00
Matthias Clasen
9f579edfdb widget-factory: Put a video widget in
The designers wanted the frame column gone for a long
time, since inset/outset/groove etc are not the coolest
features anymore.

Keep one frame, and put a GtkVideo in it.

This opens up some real estate on page 1. Suggestions
welcome for how to fill it.
2020-04-26 14:08:40 -04:00
Matthias Clasen
f6af2d63b0 widget-factory: Implement the print action
Implement enough here to show a print dialog.
2020-04-26 14:08:35 -04:00
Matthias Clasen
8de774dde1 widget-factory: Make print a window action
We want to pass the parent window when opening
a print dialog, so this is naturally a window
action.
2020-04-26 10:45:40 -04:00
Matthias Clasen
8410e6f129 widget-factory: Some cosmetics
Hook the Print button on page 3 up to the app.print
action. This doesn't do anything now, but we might
use it to show a print dialog.
2020-04-26 10:02:11 -04:00
Matthias Clasen
ecf8e6f692 widget-factory: Improve the layout on page 3
Make the entries in the third column expand,
to align things.
2020-04-26 10:00:14 -04:00
Matthias Clasen
6f7bd37aeb widget-factory: Update copyright year 2020-04-26 00:45:06 -04:00
Matthias Clasen
f645c063fb gtk-demo: Update copyright year 2020-04-26 00:44:48 -04:00
Matthias Clasen
44e31855ca gtk-demo: Remove the colorsel demo
We already have a color selector demo in "Pickers".
2020-04-26 00:28:13 -04:00
Matthias Clasen
c6fc7d88c2 gtk-demo: Minor cosmetic fixes
Some minor cosmetic fixes to some of the demos.
2020-04-26 00:28:13 -04:00
Matthias Clasen
f6c8af6609 gtk-demo: Improve the dnd demo
The DND demo didn't have DND, since it was first created!
Time to fix this. Copying most of testdnd3.c here.
2020-04-26 00:28:13 -04:00
Matthias Clasen
f8f391ceb9 gtk-demo: Polish the clipboard demo
The DND part of this demo was broken by recent
icon theme changes. Make it work again.

And make the demo nicer by breaking out a
DemoImage widget.
2020-04-25 21:29:39 -04:00
Matthias Clasen
79e1c66657 gsk: Don't autoinclude backend-specific headers
Don't install headers for code that we don't build.
And don't include those headers in gsk.h.

Just as we do in gdk, require applications to include
the backend-specific headers they need explicitly.

Update the one affected demo, gtk4-node-editor.
2020-04-24 21:40:30 -04:00
Matthias Clasen
02fa948914 widget-factory: Improve the theme selector
Implement the "Current style" choice using
gtk_settings_reset_property, so we go back to
following the settings changes.
2020-04-24 21:12:20 -04:00
Carlos Garnacho
ccfffb2578 demos: Initialize brush size in "paint" demo
Otherwise lines end up with 0 thickness.
2020-04-24 22:20:09 +02:00
Matthias Clasen
250036259a widget-factory: Make color swatches non-focusable 2020-04-18 03:29:13 -04:00
Matthias Clasen
19dbbf6fa5 aspectframe: Modernize
Make GtkAspectFrame not derive from GtkFrame anymore,
since frames now always draw, well, a frame. Also,
add proper setters for the properties of GtkAspectFrame.

Update our sole user.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2627
2020-04-17 17:38:52 -04:00
Matthias Clasen
5a362c6759 nodeeditor: Don't set has-focus
That is now a readonly property. Set focus-widget
on the toplevel instead.
2020-04-17 16:17:01 -04:00
Matthias Clasen
416d82c81e widget-factory: Add a menu section title
If you can't see it, you can't theme it.
2020-04-17 13:29:56 -04:00
Matthias Clasen
12d5fdd457 menubutton: Drop relief
We are only using this as a boolean, so change it
to a boolean property named has-frame.
2020-04-17 10:57:36 -04:00
Matthias Clasen
df1816a29c button: Drop relief
We are only using this as a boolean, so change it
to a boolean property named has-frame.
2020-04-17 10:57:36 -04:00
Matthias Clasen
edae2a8dc5 frame: Drop shadow-type
Frames that don't draw frames are not very useful,
so just drop the shadow-type property.
2020-04-17 10:57:36 -04:00
Matthias Clasen
285aa226e5 scrolledwindow: Drop shadow-type
We were only using this as a boolean, so change it
to a boolean property named has-frame.
2020-04-17 10:57:36 -04:00
Matthias Clasen
3469a63453 widget-factory: Use a model for the complex menu
We had the model already in the ui file, but weren't
using it.
2020-04-17 09:07:17 -04:00
Matthias Clasen
4a20a3fdb2 widget-factory: Catch errors
This speeds up the debugging when doing quick experimental
changes to widget-factory.ui.
2020-04-17 08:55:56 -04:00
Matthias Clasen
b072ad9993 widget-factory: Add menu style class in popovers
We have a hand-rolled popover menu on page 3 that looks
really bad right now. Adding the menu style class makes
it all better.
2020-04-15 11:36:09 -04:00
Matthias Clasen
638508fa20 gtk-demo: Group the OpenGL demos 2020-04-12 21:58:07 -04:00
Matthias Clasen
ce6c7bae51 gtk-demo: Add a gears demo 2020-04-12 20:52:15 -04:00
Matthias Clasen
394ea32e93 Use gtk_widget_add/remove_css_class more
Replace most uses of gtk_style_context_add/remove_class
by the new APIs. The only remaining uses of the old API
are in save/restore situations.
2020-04-10 12:09:57 -04:00
Matthias Clasen
822c2aba36 scalebutton: Don't derive from GtkButton
Make GtkScaleButton a widget that has a toggle button
as a child, just like all the other button widgets now.
The immediate benefit of this arrangement is to avoid
the "double focus" problem when we pop up the popup.

Update accessible, demos and tests to match.
2020-04-09 20:43:45 -04:00
Matthias Clasen
22e1827f84 Change the default value of GtkWidget:can-focus
Make widgets can-focus by default, and change the semantics
of can-focus to be recursive . If it is set to FALSE, focus
can not enter the widget or its descendents at all anymore.

This commit temporarily breaks focus behavior of widgets
that did not expect to receive focus.
2020-04-09 17:50:29 -04:00
Matthias Clasen
0b17658a82 Replace most uses of <Primary> with <Control>
The only place where we are still using <Primary> is
in tests, to ensure we keep parsing it. Otherwise,
<Control> is now the preferred syntax.
2020-04-06 17:05:52 -04:00
Matthias Clasen
33928a52c3 gtk-demo: Fix a crash
Using the assistant demo repeatedly was crashing.
2020-04-04 15:35:18 -04:00
Matthias Clasen
b636df7784 Merge branch 'matthiasc/for-master' into 'master'
shortcuts: documentation fixes

See merge request GNOME/gtk!1628
2020-04-04 15:33:41 -04:00
Matthias Clasen
f2d6a7b36a demos: Remove can-focus from ui files 2020-04-04 00:28:34 -04:00
Matthias Clasen
e31bbb41d2 gtk-demo: Remove the popover demo
It doesn't work anymore, since popovers now need
support in the parent, and we don't really need
a demo just for popovers. They are used everywhere
already.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2429
2020-04-01 15:45:13 -04:00
Jakub Steiner
e9082fd9f3 widget-factory: avoid the T word
- style variant sound more appropriate
2020-03-30 14:28:47 +02:00