Commit Graph

2152 Commits

Author SHA1 Message Date
Matthias Clasen
9f03462ffb gtk-demo: Improve the scrolling demo
Add an fps label to the scrolling demo.
2020-09-13 23:43:45 -04:00
Matthias Clasen
3b11896581 gtk-demo: Impove the fishbowl demo
Use tnum for the fps label to avoid jiggling.
2020-09-13 23:43:45 -04:00
Matthias Clasen
c66a8cb941 gtk-demo: Use gdk_frame_clock_get_fps
Remove another copy of this code in the theme
switching benchmark.
2020-09-13 23:43:45 -04:00
Matthias Clasen
9d6990fdb9 gtk-demo: Don't offer to run titles
When a group is selected (such as 'Benchmark'),
make the run button insensitive - there is nothing
to run.
2020-09-13 17:55:10 -04:00
Matthias Clasen
3f1fa66479 Demo thyself
Make gtk-demo show itself as a useful example.
2020-09-13 17:54:58 -04:00
Matthias Clasen
d732c869c2 gtk-demo: Add keywords to demos
Add the names of the main widgets as keywords to
our demos, but also things like "game". This helps
finding relevant demos in our growing list. You
can now for example type "label", and find the
"error states" and "links" demos showing GtkLabel
features.
2020-09-13 15:00:14 -04:00
Matthias Clasen
691261c71a gtk-demo: Support keywords for search
Filter the sidebar on keywords that can be provided
by the demos. We extract keywords from the doc comment
at the top of each demo source by looking for words that
look like class names. We also allow to specify keywords
explicitly.
2020-09-13 15:00:14 -04:00
Matthias Clasen
fe6f70efe1 gtk-demo: Ignore some lines in info
Ignore lines starting with # in the info comment at
the top of source files. This will be used to add
keywords for search in following commits.
2020-09-13 14:42:03 -04:00
Matthias Clasen
a90801e696 gtk-demo: Add another demo
This one is a more or less direct copy of the
settings dialog from widget-factory, demonstrating
error states and builder scopes.
2020-09-13 12:36:30 -04:00
Matthias Clasen
7518fd0d70 gtk-demo: Make F11 toggle fullscreen
In the video player demo, we have a button to make
the window fullscreen, but no easy way back. Add
the usual F11 keybinding, to make things at least
somewhat recoverable.
2020-09-13 02:31:41 -04:00
Matthias Clasen
52304fe7da gtk-demo: Add some example videos
Add buttons to show the gtk-logo animation and
the Big Buck Bunny trailer.
2020-09-13 01:51:55 -04:00
Matthias Clasen
8f593827cf widget-factory: Fix error states demo
Fix a corner case of input validation in the settings
dialog.
2020-09-13 00:17:19 -04:00
Matthias Clasen
fc720b57e2 gtk-demo: Don't refer to removed demos
The animated background demos was referring to the
pixbuf demo that was removed a while ago. Reword
the text accordingly.
2020-09-13 00:17:19 -04:00
Matthias Clasen
71ea619274 gtk-demo: Add an emblem demo
Add a simple demo for adding emblems to icons
using GdkPaintable.
2020-09-11 21:09:41 -04:00
Matthias Clasen
f679ba566e gtk-demo: Tweak the animated paintable
Make it possible to have no background in
the animated paintable. This will be used
in a future demo.

Update all users.
2020-09-11 21:08:36 -04:00
Matthias Clasen
2679e29375 gtk-demo: Fix a few crash
The paintable demos were forgetting to clear
their window variable.
2020-09-11 21:07:10 -04:00
Matthias Clasen
93078e52c0 gdk: Rename GdkSurfaceState to GdkToplevelState
That is what it is.

Fixes: #2790
2020-09-10 00:39:03 -04:00
Matthias Clasen
d6807b966c shadertoy demo: Cosmetic fixes 2020-09-08 20:08:23 -04:00
Matthias Clasen
3921476504 Merge branch 'shadertoy-demo' into 'master'
gtk-demo: Add shadertoy demo

See merge request GNOME/gtk!2540
2020-09-08 23:47:54 +00:00
Andreas Persson
81c835c418 Fix warning in listview_settings demo
Fix a warning introduced when sorter constructors were changed to return
exact types.
2020-09-08 18:48:54 +02:00
Matthias Clasen
cb2b0688ca Merge branch 'filter-constructors' into 'master'
Filter constructors

See merge request GNOME/gtk!2360
2020-09-08 12:58:27 +00:00
Alexander Larsson
0092a08dfc gtk-demo: Add shadertoy demo
This adds a small demo of using OpenGL shaders, it renders a quad
over the entire widget with a custom fragment shader. The coordinates
and the uniform names are compatible with the ones on shadertoy.com
(although some features, like texture inputs are missing currently).

The default shader in the demo is
https://www.shadertoy.com/view/wsjBD3 which is CC0, so it is
redistributable by Gtk+ (most other shaders are CC-BY-NC-SA which
isn't obviously compatible). I also added a set of buttons loading
a few other CC0 shaders I found.
2020-09-08 09:56:25 +02:00
Matthias Clasen
8c8baa9aa6 gtk-demo: Add some comments
Add some comments to the math in the transforms demo.
2020-09-06 08:43:58 -04:00
Matthias Clasen
8b38d1895c gtk-demo: Simplify the constraints demos
Give them all a close button in the header.
2020-09-05 22:54:16 -04:00
Matthias Clasen
24389a0ef5 Make sorter constructors return exact types
Make functions like gtk_custom_sorter_new() return
the actual type they construct.

Update all callers.
2020-09-05 21:50:15 -04:00
Matthias Clasen
dfabe74c59 Make filter constructors return exact types
Make functions like gtk_custom_filter_new() return
the actual type they construct.

Update all callers.
2020-09-05 21:43:42 -04:00
Ahmed Eldemery
cbd3158d91 add a missing comma 2020-09-05 13:49:01 +02:00
Matthias Clasen
c1bf9f3b41 layoutmanager demo: Make icons come out upright
Rearrange the vertices so that the icons show
up in the proper orientation.
2020-09-04 13:40:10 -04:00
Benjamin Otte
1a445d79c4 Merge branch 'demo_css_pixbufs_fix' into 'master'
gtk-demo: Fix CSS in pixbufs demo

See merge request GNOME/gtk!2529
2020-09-04 14:40:36 +00:00
Björn Daase
3bcbb4a7cc gtk-demo: Fix CSS in pixbufs demo 2020-09-04 16:14:09 +02:00
Matthias Clasen
acc2516b3c Add another layout manager demo
This demo uses transforms to place icons on a sphere.
2020-09-03 10:09:22 -04:00
Matthias Clasen
fd7a9069ce Cosmetic improvement to the layout manager demo
Give this a better title, since we will have more
than one layout manager demo soon.
2020-09-03 10:09:22 -04:00
Matthias Clasen
b628338db3 list widgets: Simplify the constructors
Now that both arguments to the _new_with_factory() constructors
are nullable, there's no good reason to keep a separate _new()
around. Just make gtk_list_view_new() and gtk_grid_view_new()
take both a model and a factory.
2020-09-01 12:24:06 -04:00
Matthias Clasen
8d79a32c50 list widgets: Use selection models in the api
Change the apis in GtkListView, GtkColumnView and
GtkGridView to be explicitly about GtkSelectionModel,
to make it obvious that the widgets handle selection.

Update all users.
2020-08-31 17:15:05 -04:00
Matthias Clasen
ccb447da02 Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

Closes #2777

See merge request GNOME/gtk!2503
2020-08-31 16:30:21 +00:00
Matthias Clasen
b98352de3e widget-factory: Stop using radio buttons
Use grouped toggle buttons for the view switcher
on page 2.
2020-08-30 22:17:31 -04:00
Matthias Clasen
1125a4379c iconbrowser: Stop using radio buttons
Replace them with grouped toggle buttons.
2020-08-30 22:14:05 -04:00
Matthias Clasen
f085ac837c fontrendering demo: Stop using radio buttons
Replace them with grouped toggled buttons.
2020-08-30 22:14:05 -04:00
Matthias Clasen
2c5c938f0d Clean up uses of gtk_toggle_button_get/set_active
Replace all uses on check buttons by the corresponding
check button api.
2020-08-30 21:23:25 -04:00
Matthias Clasen
c9eb497989 gtk-demo: Fix up the fontrendering demo 2020-08-30 21:23:14 -04:00
Matthias Clasen
7a05381825 gtk-demo: Port to font explorer to grouped checkbuttons
Stop using radio buttons here.
2020-08-30 17:59:23 -04:00
Matthias Clasen
e21b6a5721 widget-factory: Fix up radio buttons
Keep calling them radiobutton, since that is what they are.
And make the insensitive second group of three match what
we have in gtk3-widget-factory, and be parallel to the
insensitive checkbuttons next to it.
2020-08-30 17:59:23 -04:00
Matthias Clasen
c51f69c446 gtk-demo: Cosmetic change to the css shadows demo
Make the text view in the bottom take up the bulk
of the window, as it used to be.
2020-08-29 16:42:30 -04:00
Timm Bäder
1375fb4464 Change button hierarchy
A radiobutton without indicator is really just a togglebutton with a
group.

A radiobutton with indicator is really just a checkbutton with a group.

Make checkbutton its own widget not inheriting from GtkButton.
GtkRadioButton could be removed but it stays for now.

Radiobutton && !draw-indicator => Togglebutton
Checkbutton && !draw-indicator => Togglebutton

Radiobutton && draw-indicator => CheckButton + group
2020-08-29 16:46:28 +02:00
Timm Bäder
21e2c7fa33 icon-browser: Add .navigation-sidebar to sidebar 2020-08-29 11:11:29 +02:00
Emmanuele Bassi
ebef48f7df demo: Fix the resource path for css_pixbufs demo
Fixes: #3099
2020-08-28 18:39:59 +01:00
Timm Bäder
620388a071 gtk4-demo: Add background to CSS Basics demo
So people can at least read the textview contents
2020-08-28 04:35:46 +02:00
nana-4
09fa3886ba gtk-demo: Avoid double borders in the blendmodes demo 2020-08-25 21:24:10 +09:00
nana-4
bb7d5b2de6 gtk-demo: Avoid double borders in the fontrendering demo
Replace the frame with a separator.
2020-08-25 21:24:10 +09:00
nana-4
d906242c78 gtk-demo: Avoid double borders in the dnd demo
Replace the frame with a separator.
2020-08-25 21:24:10 +09:00
nana-4
d9e8223b03 gtk-demo: Avoid double borders in the panes demo
Using frames for the children of the panes looks bad.
2020-08-25 21:24:10 +09:00
Matthias Clasen
bdaf346128 gtk-demo: Make the color picker demo less boring
Maybe the first ever use of the add_palette api.
Surprise, it doesn't work!
2020-08-24 17:19:36 -04:00
Ahmed Eldemery
86acb13057 fix position of radiobutton1 2020-08-23 17:39:17 +02:00
Matthias Clasen
ab5e62ddab Merge branch 'matthiasc/for-master' into 'master'
layoutmanager: Fix the child-widget property

Closes #3080

See merge request GNOME/gtk!2460
2020-08-21 20:45:53 +00:00
Matthias Clasen
936f3f1ad9 Explicitly set grid positions in the ui file
We were outsmarted by a combination of gtk-builder-tool
removing default values and GtkGrid guessing good values
for omitted properties.

Fixes: #3080
2020-08-21 16:22:59 -04:00
Björn Daase
6315cd977c *: Fix spelling mistakes found by codespell 2020-08-21 15:29:34 +02:00
Jakub Steiner
dd2e1e4867 Merge branch 'wip/jimmac/rich-list-styling' into 'master'
Adwaita: rich-list styling

See merge request GNOME/gtk!2456
2020-08-20 20:58:31 +00:00
Jakub Steiner
5f630481db Adwaita: rich-list styling
FIXME: why is the second list in Demo>List Box>Controls taller?

https://gitlab.gnome.org/GNOME/gtk/-/issues/3073
2020-08-20 19:39:18 +02:00
Matthias Clasen
8acd60fda9 widget-factory: Improve the error states example
Elaborate the error state handling, and make it show
delayed states in GtkSwitch too.
2020-08-19 13:22:44 -04:00
Matthias Clasen
fa0a88ae22 Merge branch 'api-touchups' into 'master'
Api touchups

See merge request GNOME/gtk!2439
2020-08-14 12:47:50 +00:00
Matthias Clasen
ae7cefd97d Drop style class defines
We document the supported style classes by name,
not by macro name, and these macros don't really
add any value. Drop them for GTK 4.
2020-08-14 07:03:27 -04:00
Matthias Clasen
0ae7f794a3 Merge branch 'matthiasc/for-master' into 'master'
gtk-demo: Fix the builder demo

See merge request GNOME/gtk!2437
2020-08-13 23:44:58 +00:00
Matthias Clasen
15bd2a2a5c Merge branch 'fix_expander_demo' into 'master'
fix resource not found in expander demo

See merge request GNOME/gtk!2436
2020-08-13 23:08:09 +00:00
Matthias Clasen
005f9a995e gtk-demo: Fix the builder demo
The about dialog here wasn't working.
At the same time, make the statusbar
useful for something by showing our
action messages there.
2020-08-13 17:19:59 -04:00
Matthias Clasen
e48a1d2df0 Merge branch 'list-styles' into 'master'
Implement and document list styles

See merge request GNOME/gtk!2421
2020-08-13 21:15:22 +00:00
Ahmed Eldemery
6037d08bd8 fix resource not found in expander demo 2020-08-13 22:46:38 +02:00
Matthias Clasen
bcc5e475fc gtk-demo: Do markup parsing incrementally too
Pango has a markup parser api, might as well
use it to keep things responsive.
2020-08-13 16:33:16 -04:00
Matthias Clasen
a0cdb544ed gtk-demo: Fix the Windows build 2020-08-13 16:33:16 -04:00
Matthias Clasen
80cddd4cc1 gtk-demo: Move the highlighting to a separate file
Move all the logic related to asynchronous highlighting
to fontify.c, to keep main.c from becoming too cluttered.
2020-08-13 16:33:16 -04:00
Matthias Clasen
2b0e9542cb gtk-demo: take off the makeup
Remove all the hardcoded spacing from the listbox
demo, so the rich-list styling can take effect.
2020-08-13 16:30:22 -04:00
Matthias Clasen
d1b1b5bd9b widget-factory: Use rich-list style
Use the .rich-list style for the listbox on page 2.
2020-08-13 16:30:22 -04:00
Matthias Clasen
283fc9d7e4 gtk-demo: Use style classes in the listbox demo
Add a .rich-list style class to the controls demo.
2020-08-13 16:30:22 -04:00
Matthias Clasen
d8753a9fa3 gtk-demo: Use style classes in the settings demo
Use .navigation-sidebar on the left, and .data-table
on the right.
2020-08-13 16:30:22 -04:00
Matthias Clasen
a9858c6662 gtk-demo: Use a style class on the sidebar
Use .navigation-sidebar for the main sidebar.
2020-08-13 16:30:21 -04:00
Matthias Clasen
aacb06dbee gtk-demo: Insert markup incrementally
The slowest step of highlighting our buffers is
inserting the markup into the buffer. Do that
incrementally, to avoid blocking the UI for
extended periods.
2020-08-13 12:59:52 -04:00
Matthias Clasen
4c78f628db gtk-demo: Fontify asynchronously
Run highlight asynchronously. It isn't a problem for
most demos, but the cursor demo has an unusually large
ui file, which takes highlight a little bit of time
to produce.
2020-08-13 12:25:38 -04:00
Matthias Clasen
e9afb63a01 widget-factory: Add more error states
Add a label with the .error style class in the
configuration dialog, also add another entry validation
here, to have it in one place.
2020-08-13 07:40:54 -04:00
Matthias Clasen
7226878916 gtk-demo: Group small images
Instead of showing 30 tabs, put all the cursor images
into one page.  Do the same for the small images in
the css animated background demo.
2020-08-12 20:26:15 -04:00
Matthias Clasen
94696490dc widget-factory: Add an entry with error state
Enter the wrong thing into the age entry for seeing
error states.
2020-08-12 13:26:46 -04:00
Matthias Clasen
0a9acd10d2 gtk-demo: Celebrate losses too
Everybody is a winner!
2020-08-11 23:26:06 -04:00
Matthias Clasen
3340a5ee04 gtk-demo: Visual improvement to solitaire
Make the fields visible.
2020-08-11 23:10:48 -04:00
Matthias Clasen
5e2aeee9b0 gtk-demo: Add a layout manager demo
This is more or less a copy of the layout manager
example from clutter.
2020-08-11 23:10:48 -04:00
Matthias Clasen
540cffee89 gtk-demo: Drop the pixbufs demo
It is from a different era, and doesn't show
the apis we want to promote. The visuals live
on, in the Css/Animated Backgrounds demo.
2020-08-11 16:26:04 -04:00
Matthias Clasen
82253d1a0a gtk-demo: Give the video player a default size 2020-08-10 16:36:36 -04:00
Matthias Clasen
19b93fc9f7 gtk-demo: Add a file filter for the video player
We are only interested in video files here.
2020-08-10 16:36:36 -04:00
Matthias Clasen
63fb2126db gtk-demo: Make the image demo more robust
Make sure we don't crash if the demo is closed
early.

Fixes: #3058
2020-08-10 16:35:56 -04:00
Matthias Clasen
8cbca4f693 print-editor: Icon credits
Give the artist credits.
2020-08-09 20:30:00 -04:00
Matthias Clasen
6e9de7f271 node-editor: Don't install the icon
We don't want to install an icon if we're not
installing the app. Also give the artist credit.

Fixes: #3051
2020-08-09 20:28:56 -04:00
Matthias Clasen
aa1b9531c1 gtk-demo: Add a little extra in peg solitaire
A win needs to be celebrated!
2020-08-09 18:59:29 -04:00
Matthias Clasen
e5247b7cbb gtk-demo: Finish peg solitaire demo
The restart button was simply not implemented.
While we are at it, make the pegs a bit bigger,
so clicking them is easier.
2020-08-09 18:27:18 -04:00
Matthias Clasen
da0955feeb gtk-demo: Cosmetic fixes to the textmask demo
Make this come up with the right size.
2020-08-09 18:05:27 -04:00
Matthias Clasen
2335953c5d gtk-demo: Cosmetic fixes for the fontrendering demo
Make this look a bit less thrown together.
2020-08-09 18:02:04 -04:00
Matthias Clasen
42902085e5 gtk-demo: Dark theme support for dnd demo
Add minimal dark theme support to the dnd demo,
by picking suitable default colors for our items.
2020-08-09 17:36:41 -04:00
Matthias Clasen
230107cd84 gtk-demo: Cosmetic improvements to the expander demo
Set the textview up like our other readonly textviews.

Also sneak in a little easter egg.
2020-08-09 17:12:04 -04:00
Matthias Clasen
b69dc3d054 gtk-demo: Add warnings to the themes demo
Add a warning that the flickering here may be
hazardous to photosensitive viewers.
2020-08-09 16:36:00 -04:00
Matthias Clasen
4650f7ec14 gtk-demo: Cosmetic improvement to listbox2 demo
Make the checkbutton and the check align vertically.
2020-08-09 15:43:01 -04:00
Matthias Clasen
eb5329d389 gtk-demo: Group the listbox demos 2020-08-09 12:36:06 -04:00
Matthias Clasen
5b41612f28 gtk-demo: Add another listbox demo
This is a more typical listbox use.
2020-08-09 12:36:06 -04:00
Matthias Clasen
3760d44f18 gtk-demo: Fix an indentation mishap 2020-08-09 11:14:28 -04:00
Matthias Clasen
79f0687929 gtk-demo: Drop the modelbutton demo
Not a public api, so shouldn't be featured in a demo.
2020-08-09 10:59:22 -04:00