Commit Graph

2230 Commits

Author SHA1 Message Date
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
Matthias Clasen
c80a612af7 gtk-demo: Improve filtering
Show sidebar rows if any parent matches. This lets one
search for "lists" and get just the subtree with all the
listview demos.
2020-08-09 10:54:45 -04:00
Matthias Clasen
7f565806a8 gtk-demo: Make source formatting uniform
Give the text view in the source tab the same
formatting as tabs we add for extra sources.
2020-08-09 00:03:43 -04:00
Matthias Clasen
1d49f933e9 gtk-demo: Adapt hightlighting style for dark themes
Switch to a highlight style that is readable with
dark background, if prefer-dark is set or we are
in HighContrastInverse.
2020-08-08 23:50:45 -04:00
Matthias Clasen
1d1d9de09e gtk-demo: Cosmetics 2020-08-08 23:41:50 -04:00
Matthias Clasen
d1aacc01d4 gtk-demo: Make content views monospace
That works better for code.
2020-08-08 23:41:05 -04:00
Matthias Clasen
2a3d3ec079 gtk-demo: Follow font settings again
highlight puts font and size information into
its pango markup; strip that out to make our
text follow font settings again.
2020-08-08 23:38:07 -04:00
Matthias Clasen
112883186c gtk-demo: Fix iconscroll complex text
We changed the way fontify works.
Adapt the iconscroll use.
2020-08-08 14:38:18 -04:00
Matthias Clasen
57a213a4ea gtk-demo: Fix iconscroll colors
We changed the way the color grid works.
Adapt the iconscroll use of it.

Fixes: #3030
2020-08-08 14:36:48 -04:00
Matthias Clasen
4f5e3b7b0d gtk-demo: Improve an error message
Be more helpful when we can't do syntax highlighting.
2020-08-08 13:56:17 -04:00
Matthias Clasen
d099276b89 printeditor: Create the dialog every time
Trying to work around gtk_show_about_dialog() is
not worth it, just recreate the dialog from scratch.
2020-08-08 11:48:32 -04:00
Matthias Clasen
56afa05b97 widgetfactory: Create the dialog every time
Trying to work around gtk_show_about_dialog() is
not worth it, just recreate the dialog from scratch.

Fixes: #3047
2020-08-08 11:48:32 -04:00
Matthias Clasen
2d72ba21ce gtk-demo: Don't leak the markup 2020-08-07 15:19:33 -04:00
Matthias Clasen
e0786a4a00 gtk-demo: Fix a memory leak
The colors demo was leaking a reference to its model.
This was showing up as crash when you manage to close
both the demo window and the main window while the
sorting is ongoing.
2020-08-07 15:15:18 -04:00
Matthias Clasen
05255bfc90 gtk-demo: Modernize source highlighting
Drop the homegrown highlighting code, and just use highlight
to produce Pango markup.

When using an external highlighter, we can also highlight css,
xml, headers, at least.
2020-08-07 11:54:10 -04:00
Matthias Clasen
87a8fda163 demos: Brush up about dialogs
Show OS info, and generally polish this here and there.
2020-08-06 22:17:36 -04:00
Matthias Clasen
79e6269058 Merge branch 'gtk-demo-leaks' into 'master'
Gtk demo leaks

See merge request GNOME/gtk!2393
2020-08-07 01:36:34 +00:00
Matthias Clasen
14900efe38 gtk-demo: Plug a big memory leak
The colors demo was leaking all its colors. Oops.
2020-08-06 21:14:11 -04:00
Matthias Clasen
04c3c659f5 gtk-demo: Plug a small memory leak
The settings demo was leaking a GtkBuilderScope.
2020-08-06 21:13:39 -04:00
Benjamin Otte
8557aaf327 demo: fix memleak 2020-08-07 02:53:21 +02:00
Benjamin Otte
278fbcbbb4 demo: Don't crash when closing words demo
Make sure the stringlist we're loading into doesn't go away.

It'd be better to have a cancellable, but I'm lazy.
2020-08-07 02:52:22 +02:00
Matthias Clasen
dcf37412c1 gtk-demo: Fix keynav in the puzzle demo
Fixes: #3023
2020-08-05 20:52:22 -04:00
Matthias Clasen
b58bad557b gtk-demo: Make fontrendering demo work more than once
We weren't cleaning up properly, causing the window
to not close the second time it is opened.

Fixes: #3019
2020-08-05 14:36:54 -04:00
Matthias Clasen
af63893377 Merge branch 'search-demo-fixes' into 'master'
Search demo fixes

Closes #3004

See merge request GNOME/gtk!2354
2020-08-03 02:18:41 +00:00
Matthias Clasen
3304df7042 Merge branch 'tagged-entry-demo' into 'master'
gtk-demo: Simplify the tagged entry demo

Closes #3005

See merge request GNOME/gtk!2353
2020-08-03 02:18:28 +00:00
Matthias Clasen
df85ef1754 gtk-demo: Fix cleanup of search entry demo
We can't use the ::destroy signal anymore; use
a weak ref instead, and make ensure the entry
stays around long enough for us to finish the
cleanup.

Fixes: #3004
2020-08-02 21:53:59 -04:00
Matthias Clasen
a7e25f2c73 gtk-demo: Make search progress visible again
Set a progress fraction, so that the pulsing progress
in the search entry demo is actually visible.
2020-08-02 21:47:21 -04:00
Matthias Clasen
4bdd94fd3f gtk-demo: Simplify the tagged entry demo
No need for an intermediate box widget here;
we can just use a box layout. As a side-effect,
this fixes the theme to apply to the selection.

Fixes: #3005
2020-08-02 21:39:23 -04:00
Matthias Clasen
af07cfea5f gtk-demo: Avoid invalid OpenType feature tags
ss00 doesn't exist, and we use xxxx as placeholder
for 'default' choices in alternatives. Add a warning
in case we run across invalid OpenType feature tags
in fonts.

Fixes: #2962
2020-08-02 21:13:37 -04:00
Matthias Clasen
ed13e6a41e grid layout: Rename some properties
Rename GtkGridLayoutChild:left-attach/top-attach to
GtkGridLayoutChild:column/row. Update all users.

Fixes: #2967
2020-08-02 17:58:03 -04:00
Timm Bäder
954a144336 mediastream demo: Add a weak pointer to the window
Do what other demos do as well.

Fixes 2983
2020-08-01 08:59:46 +02:00
Chun-wei Fan
c97979873a demos: Fix running on Visual Studio builds
We need to mark the non-static callback functions for export.
2020-07-31 23:20:25 +08:00
Chun-wei Fan
e5600ab99b demos: Fix glarea demo on OpenGL/ES
Some implementations of the ES 1.00 shader (such as Google's ANGLE) do
not like the 'f' suffix for floats, so just drop it, as it should be
harmless to drop.
2020-07-30 14:26:33 +08:00
Matthias Clasen
9722bb4d9e iconbrowser: Add screenshots to appdata
appstream validation is picky and insists we have
at least on screenshot.
2020-07-29 20:23:46 -04:00
Matthias Clasen
ad3514216d Update our appdata files
Mention the new release in all our appdata files.
2020-07-29 17:58:45 -04:00
Matthias Clasen
59fce30200 icon-browser: Install desktop file and appdata
That is needed to make the flatpak build in our
ci happy.
2020-07-29 17:42:49 -04:00
Timm Bäder
b213b01200 widget-factory: Remove useless separators
They don't serve a purpose and are not relevant for theming purposes.
2020-07-28 06:14:45 +02:00
Timm Bäder
d5f0256f8b listbox demo: Remove frames around labels
Having frames around those labels looks stupid
2020-07-28 05:34:12 +02:00
Matthias Clasen
99ec400c2a gtk-demo: Simplify colors demo
Make best use of our new constructors.
2020-07-27 13:30:00 -04:00
Matthias Clasen
bc0182fa3e Merge branch 'ebassi/new-a11y' into 'master'
Accessibility rework

See merge request GNOME/gtk!2239
2020-07-27 11:55:19 +00:00
Matthias Clasen
d187ff858c Merge branch 'drop-down-constructor' into 'master'
GtkDropDown api revisions

See merge request GNOME/gtk!2286
2020-07-26 23:57:48 +00:00
Matthias Clasen
eb5c76210e gridview: Revise constructors
Make both gtk_grid_view_new and gtk_grid_view_new_with_factory
take a model as first argument, and make all arguments
allow-none and transfer full.

Update all callers.
2020-07-26 18:50:50 -04:00
Matthias Clasen
43000abeff listview: Revise constructors
Make both gtk_list_view_new and gtk_list_view_new_with_factory
take a model as first argument, and make all arguments
allow-none and transfer full.

Update all callers.
2020-07-26 18:27:23 -04:00
Matthias Clasen
f7ab6f665d dropdown: Revise constructors
A dropdown without a model is useless, so accept a model
and expression in the constructor. Allow them to be NULL,
but consume them if given. This makes chained constructors
convenient without breaking language bindings.

Drop gtk_drop_down_set_from_strings() and instead add
gtk_drop_down_new_from_strings().

Update all users.
2020-07-26 18:09:54 -04:00
Matthias Clasen
cdc263f796 multiselection: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Also make the constructor return GtkMultiSelection *.

Update all callers.
2020-07-26 18:04:40 -04:00
Matthias Clasen
ccb9dcc86b singleselection: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 18:04:40 -04:00
Matthias Clasen
68d6671413 noselection: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 18:04:40 -04:00
Matthias Clasen
dd1c0c0b22 treelistmodel: Make constructor transfer full
Make gtk_tree_list_model_new() take the root model
as first argument, and make it transfer full, for
consistency with other wrapping list constructors.

Update all callers.

Still missing here: Make the model property writable,
and allow passing NULL in the constructor.
2020-07-26 18:04:40 -04:00
Matthias Clasen
a46cfd3ff4 sortlistmodel: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 18:04:40 -04:00
Matthias Clasen
706d464ae6 filterlistmodel: Make constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 18:04:40 -04:00
Matthias Clasen
1e8be87026 flattenlistmodel: Make the constructor transfer full
This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.
2020-07-26 18:02:44 -04:00
Emmanuele Bassi
c63087a563 Remove ATK
To build a better world sometimes means having to tear the old one down.
        -- Alexander Pierce, "Captain America: The Winter Soldier"

ATK served us well for nearly 20 years, but the world has changed, and
GTK has changed with it. Now ATK is mostly a hindrance towards improving
the accessibility stack:

 - it maps to a very specific implementation, AT-SPI, which is Linux and
   Unix specific
 - it requires implementing the same functionality in three different
   layers of the stack: AT-SPI, ATK, and GTK
 - only GTK uses it; every other Linux and Unix toolkit and application
   talks to AT-SPI directly, including assistive technologies

Sadly, we cannot incrementally port GTK to a new accessibility stack;
since ATK insulates us entirely from the underlying implementation, we
cannot replace it piecemeal. Instead, we're going to remove everything
and then incrementally build on a clean slate:

 - add an "accessible" interface, implemented by GTK objects directly,
   which describe the accessible role and state changes for every UI
   element
 - add an "assistive technology context" to proxy a native accessibility
   API, and assign it to every widget
 - implement the AT context depending on the platform

For more information, see: https://gitlab.gnome.org/GNOME/gtk/-/issues/2833
2020-07-26 20:31:14 +01:00
Benjamin Otte
3078b180fe Replace "gdouble" with "double" 2020-07-25 00:47:36 +02:00
Benjamin Otte
556997f9df Replace "gfloat" with "float" 2020-07-25 00:47:36 +02:00
Benjamin Otte
d375dce9f5 Replace "gchar" with "char" 2020-07-25 00:47:36 +02:00
Benjamin Otte
d7266b25ba Replace "gint" with "int" 2020-07-25 00:47:36 +02:00
Benjamin Otte
b23f793753 gtk-demo: Add a progress bar when the colors demo resorts 2020-07-22 14:30:49 +02:00
Benjamin Otte
e8c4e1205a gtk-demo: Make colors demo do incremental sorting 2020-07-22 14:30:49 +02:00
Matthias Clasen
0e476c1f28 gtk-demo: Don't use GtkColorSwatch
Making our own is 80 lines of code, so just do it.
2020-07-17 20:44:06 -04:00
Matthias Clasen
f4a7c7f6bf gtk-demo: Use better api
We have a getter for the model, lets use it.
2020-07-16 16:26:41 -04:00
Benjamin Otte
e518c1f2f3 stringfilter: Make the constructor take an expression
An expression is critically important for a string filter and people
should be made aware of it when constructing the filter.
2020-07-16 20:43:16 +02:00
Benjamin Otte
c5ea59d7d1 gtk-demo: Don't make demos modal
That way, demo windows can be maximized and multiple demos can run at
once.

It's especially useful when using --run because the main window is
invisible then.
2020-07-16 20:43:16 +02:00
Matthias Clasen
b7eb663b82 gtk-demo: Make the words demo expand
We want to fill the window here.
2020-07-13 17:54:27 -04:00
Matthias Clasen
6502d3669f print-editor: Set the devel style class
Lets clearly communicate that we're unstable.
2020-07-13 08:27:51 -04:00
Matthias Clasen
53831e67a7 Integrate the new icons
Install and use the node-editor and print-editor icons.
2020-07-13 07:30:46 -04:00
Jakub Steiner
e742fc1206 demos: icons for Print and Node Editors
- probably needs meson build hooks
2020-07-13 07:30:46 -04:00
Matthias Clasen
b4096cee64 gtk-demo: Work harder to filter the tree
Arrange for an item to be visible if it either
matches the filter or has children that do.
2020-07-12 18:26:56 -04:00
Matthias Clasen
a888e1cb65 demo: Clear filter when search is stopped
When the search entry disappears on Escape,
reset the search string to "", so we don't
end up with a filtered list and no obvious
way to remove the filtering.
2020-07-12 16:47:51 -04:00
Matthias Clasen
c80b33b2ad gtk-demo: Make the search bar appear for typing
Having the search bar present from the start is
a bit jarring. Make it appear when called for.
2020-07-12 16:26:17 -04:00
Mohammed Sadiq
7583d48266 demo: Add a search filter 2020-07-12 22:19:40 +05:30
Matthias Clasen
746b84cc0f gtk-demo: Make style apply in the file browser
Commit 5afe6f7825 claims to make this demo
'look good', but it failed to actually make its
css apply. Now it really looks good.
2020-07-12 08:11:42 -04:00
Matthias Clasen
fc770a383a gtk-demo: Use a progressbar in the words demo
This looks better and a bit more polished.
2020-07-06 03:42:43 +02:00
Matthias Clasen
62c385a9dd gtk-demo: No selection in the words demo
This demo is about filtering, not about selection,
so use a GtkNoSelection.
2020-07-06 03:42:43 +02:00
Matthias Clasen
7c4ad1a5c4 gtk-demo: Cosmetic fixes for the words demo
Set a window size, and don't put newlines in titles, left align and
ellipsize the label.
2020-07-06 03:42:43 +02:00
Benjamin Otte
ac524bb13a demo: Make words listview load async
And add an "Open" button (why are filechooser buttons such a catastrophe
that I can't make them smaller?).
2020-07-06 03:42:43 +02:00
Benjamin Otte
b64eb6ca13 gtk-demo: Add incremental filtering to words demo 2020-07-06 03:42:43 +02:00
Benjamin Otte
b54f6710a7 gtk-demo: Add a listview demo for filtering strings 2020-07-06 03:42:42 +02:00
Benjamin Otte
5080730728 listmodels: Stop respecting item-type
Simplify all view model APIs and always return G_TYPE_OBJECT as the
item-type for every model.

It turns out nobody uses item-type anyway.

So instead of adding lots of APIs, forcing people to think about it and
trying to figure out how to handle filter or map models that modify item
types, just having an easy life is a better approach.

All the models need to be able to deal with any type of object going
through anyway.
2020-07-05 02:59:21 +02:00
Matthias Clasen
cc18191a8e Merge branch 'wip/exalm/show-title-buttons' into 'master'
headerbar: Show title buttons by default

See merge request GNOME/gtk!2175
2020-07-03 05:05:24 +00:00
Matthias Clasen
671daea262 gtk-demo: Track the selection
Use GtkSelectionFilterModel to track and display the
selection. Add some other selection information for
good measure.
2020-07-02 22:59:03 -04:00
Alexander Mikhaylenko
7c3b30036e headerbar: Show title buttons by default
Most of the time show-title-buttons is set to TRUE. Go ahead and make that
the default.
2020-07-02 23:51:16 +05:00
Matthias Clasen
c0e2d7c62f Drop unnecessary uses of gtk_style_context_add_class
We can use gtk_widget_add_css_class instead, most places.
2020-06-30 17:42:30 -04:00
Matthias Clasen
c267a75eef Stop using GtkFunctionsListItemFactory
This was an early attempt at a factory, and has been
superseded by GtkSignalsListItemFactory. Port all users
the the newer one.
2020-06-29 22:10:34 -04:00
Matthias Clasen
d4ff275002 node-editor: Add a help window
Add a Help item to the gear menu that opens the
node-format.md file in a new window. This could
be improved if we could parse markdown and apply
tags, similar to how we can load pango markup.
2020-06-29 07:36:55 -04:00
Matthias Clasen
2b6f243578 node-editor: Cosmetics
Use a title style class for the labels.
2020-06-29 07:36:55 -04:00
Matthias Clasen
8770584bfb node-editor: Add a gear menu
Add a gear menu with Inspector and About menu items.
2020-06-29 07:36:55 -04:00
Matthias Clasen
4f7f15700c node-editor: Document the node format
Add a markdown file with the documentation of the
node format.

Fixes: #1887
2020-06-29 07:36:55 -04:00
Matthias Clasen
cab6808673 gtk-demo: Fix binary name in --version
We are gtk4-demo, not gtk3-demo.
2020-06-28 23:36:35 -04:00
Matthias Clasen
c4b2112f16 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #2743

See merge request GNOME/gtk!2161
2020-06-28 23:47:09 +00:00
Matthias Clasen
01fbf8444b Stop setting GTK_IM_MODULE_FILE
GTK no longer reads this environment variable, so
setting it can have no benefit for uninstalled demos
anymore.
2020-06-28 13:42:02 -04:00
Matthias Clasen
59fe4a3a09 printeditor: Add desktop file and appdata
All our installed demos have this.
2020-06-28 10:51:16 -04:00
Matthias Clasen
6774f36636 print-editor: Allow opening files
Since it calls itself an editor, it should really
support opening files on the commandline.
2020-06-28 10:51:16 -04:00
Matthias Clasen
608cbc28af printeditor: Cosmetics
Bring this up to our standards for an installable demo,
by touching up the about dialog and menus.
2020-06-28 10:51:16 -04:00
Matthias Clasen
3aa5019e70 gtk-demo: Drop an unused object
The main ui file was still creating a tree store,
but we've switched everything over to use list models.
2020-06-27 09:47:29 -04:00
Matthias Clasen
5d11e9812d gtk-demo: Improve formatting in the color demo
Properly align and format the numbers in the size
dropdown.
2020-06-26 22:57:56 -04:00
Benjamin Otte
6ceab55148 gtk-demo: Port listview-colors demo to multiselection again 2020-06-26 07:13:32 +02:00
Matthias Clasen
c9b032acab gtk-demo: Fix a typo in the listbox demo 2020-06-25 14:28:29 -04:00
Matthias Clasen
f4e200708d Merge branch 'scrolled-window-api' into 'master'
scrolledwindow: Don't take adjustments in new()

See merge request GNOME/gtk!2146
2020-06-24 19:58:03 +00:00
Matthias Clasen
3656994f82 gtk-demo: Enable inline completion
Enable inline completion in the entry completion
demo, to have some code exercising this feature.
It is broken.
2020-06-24 13:02:50 -04:00
Matthias Clasen
fd5f6ef57f gtk-demo: Improve the entry completion demo
Add more strings.
2020-06-24 13:02:50 -04:00
Matthias Clasen
386b63b85d scrolledwindow: Don't take adjustments in new()
In 99.9% of all cases, these are just NULL, NULL.
So just do away with these arguments, people can
use the setters for the rare cases where they want
the scrolled window to use a different adjustment.
2020-06-24 11:25:09 -04:00
Matthias Clasen
8a91d1d1ce Merge branch 'matthiasc/for-master' into 'master'
gtk-demo: Add a warning to the colors demo

See merge request GNOME/gtk!2131
2020-06-22 13:11:13 +00:00
Matthias Clasen
9fd3212241 gtk-demo: Add a warning to the colors demo
Explain that the big sizes cause lockups.
2020-06-22 07:43:47 -04:00
Chun-wei Fan
293f2e6b1c demos: Fix builds against Visual Studio headers
According to [1], '_timezone' is already used for a global variable in the
time.h system header that is supplied by Microsoft, so using that for our
variable name when we are including time.h either directly or indirectly
will cause trouble.

This renames such variables to '_tz' to avoid that

[1]: https://docs.microsoft.com/en-us/cpp/c-runtime-library/daylight-dstbias-timezone-and-tzname
2020-06-22 17:04:18 +08:00
Matthias Clasen
607f08e79b Port the icon browser to GtkGridView 2020-06-21 13:36:57 -04:00
Matthias Clasen
9b8c0f3c7f gtk-demo: Cosmetic improvement to the colors demo
Make the count label not jump around, as the model
is refilled.
2020-06-21 14:17:47 +02:00
Benjamin Otte
727a78a74f gtk-demo: Add an "Unsorted" option (and default to it)
Tests the previous commit and ensures that selecting 16M colors actually
works quickly (it does).
2020-06-21 14:17:47 +02:00
Benjamin Otte
d3f7dea624 gtk-demo: Reinstate incremental filling
Do it via the new size setting on the color list.

Also add an option to set the maximum size of the color list that it'll
be filled to so rudimentary performance testing is possible.

Hint: Do not select 16777216.

This reinstates commit c16848c2bb683f7ddf51571aa5951f8a4a1ea622.
2020-06-21 14:17:47 +02:00
Benjamin Otte
456b7628ee gtk-demo: Allow color list to have any size
For now, limit it to 1<<12 so the sorters don't explode.
2020-06-21 14:17:47 +02:00
Benjamin Otte
f149beb474 gtk-demo: Add a permutation to compute colors from the position
This way, the colors are furthest apart at the start and fill up the
remaining spots towards the end.
2020-06-21 14:17:47 +02:00
Benjamin Otte
1b0451761a gtk-demo: Add custom listmodel for all true colors. 2020-06-21 14:17:47 +02:00
Benjamin Otte
1d26341b03 gtk-demo: Make colors demo contain all 16,777,216 colors
This makes it slightly slow, so not sure it should stay like this.
2020-06-21 14:17:47 +02:00
Benjamin Otte
8348a113c6 gtk-demo: Compute HSV values directly 2020-06-21 14:17:47 +02:00
Benjamin Otte
bfdede7acc Revert "gtk-demo: Make the colors demo populate incrementally"
This eases adding a bunch of follow-up features. After those features
have landed, this functionality will be readded.

This reverts commit a10340859d.
2020-06-21 14:17:47 +02:00
Benjamin Otte
70894b48af gtk-demo: Embed the RGBA value 2020-06-21 14:17:47 +02:00
Benjamin Otte
3549f43902 demo: Use GtkDropDown::selected-item 2020-06-21 02:23:46 +02:00
Matthias Clasen
0214b98c5e Merge branch 'matthiasc/for-master' into 'master'
misc listview scrolling fixes

See merge request GNOME/gtk!2119
2020-06-20 21:21:29 +00:00
Matthias Clasen
a10340859d gtk-demo: Make the colors demo populate incrementally
Add a refill button that incrementally refills the color
demo. This is useful to test how the grid view operates
when the model is frequently changed.
2020-06-20 14:47:57 -04:00
Matthias Clasen
8475d88af0 gtk-demo: Clean up initial selection handling
We call selection_cb now, so we don't need to manually
do part of what that call does ahead of time.

This should have been noticed in 10bcbae68c.
2020-06-20 14:47:39 -04:00
Matthias Clasen
3fab2b55cc gtk-demo: Clean up memory handling in the weather demo
gtk_weather_info_new was consuming the info, but not
the timestamp, which confused me. Make it not consume
either, and be more explicit about where the unrefs
happen.
2020-06-20 12:18:17 -04:00
Matthias Clasen
677bfe6857 gtk-demo: Clean up initial selection handling
We call selection_cb now, so we don't need to manually
do part of what that call does ahead of time.

This should have been noticed in 10bcbae68c.
2020-06-20 08:48:29 -04:00
Matthias Clasen
eb25fc1d5a gtk-demo: Add animated icons to the dnd demo
This is to test animated drag icons.
2020-06-19 19:26:43 -04:00
Matthias Clasen
3141eaecd0 gtk-demo: Modernize the tag entry demo
Use a layout manager, and reduce boilerplate.
2020-06-19 11:42:47 -04:00