Commit Graph

140 Commits

Author SHA1 Message Date
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
1125a4379c iconbrowser: Stop using radio buttons
Replace them with grouped toggle buttons.
2020-08-30 22:14:05 -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
Björn Daase
6315cd977c *: Fix spelling mistakes found by codespell 2020-08-21 15:29:34 +02: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
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
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
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
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
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
607f08e79b Port the icon browser to GtkGridView 2020-06-21 13:36:57 -04:00
Matthias Clasen
c2285d923d iconbrowser: Drop app menu leftovers
We don't use menus.ui anymore, so don't put it in a resource.
2020-06-11 18:16:36 -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
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
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
Timm Bäder
e444d7315c demos/icon-browser: Add common_cflags to build
And fix the generated warnings
2020-03-06 18:53:05 +01:00
Matthias Clasen
b5bacb3be6 Drop the margin property
Replace it with margin-start, -end, -top, -bottom throughout.
2020-02-25 20:59:04 -05:00
Matthias Clasen
a9c05193a7 Drop the expand property
The hexpand and vexpand properties are sufficient.
2020-02-25 18:29:15 -05:00
Benjamin Otte
b8cf7ea1c6 dnd: Port the TreeModel machinery to GValue DND 2020-02-18 02:40:00 +01:00
Benjamin Otte
da83457a60 dnd: Remove gdk_content_provider_new_with_callback()
Content providers are meant to be immutable, apart from very special
cases, but in those cases they need to emit
gdk_content_provider_content_changed().

Having a constructor that just uses a get_func invites abuse of this
by not making developers aware of those requirments.
In fact, all users in GTK failed to do this.

Instead, code should use the GtkDragSource::prepare signal to create
content providers when needed.

The same problem exists with gdk_content_provider_new_with_formats(),
but this commit doesn't touch that.
2020-02-16 20:10:31 +01:00
Emmanuele Bassi
cdd7e4c5ec Add a notify function to GdkContentProvider
The callback-based content providers need a GDestroyNotify function to
free the data passed to them on construction, otherwise they are going
to leak.
2020-02-13 14:53:25 +00:00
Alexander Larsson
904eecd1ed icon paintable: Replace get_filename and get_resource_path with get_file()
This returns a GFile which can represent both the above.
2020-02-10 12:33:17 +01:00
Alexander Larsson
b529f77827 IconTheme: Simplify icon scaling
We had a pretty complex setup where we tried to avoid scaling up themes from dirs
that specified a size. However, not only was it very complex, but it didn't quite
work with window scales, because when using e.g. a size 32 directory for 16@2x
the dir size is wrong anyway. Additionally it turns out most code either picks
an existing icon size, or uses the FORCE_SIZE flags, so it doesn't seem
like a useful behaviour.

This change drops the FORCE_SIZE flags, and always scales
icons. Additionally it moves the scaling of the icon to rendering,
which seems more modern, and allows us to (later) share icons loaded
for different sizes that happened to use the same source file (at
different scales).

Note that this changes the behaviour of
gtk_icon_paintable_download_texture() is it now returns the unscaled
source icon. However, ignore thats, as I plan to remove this function
and replace it with a way to render a paintable to a cairo-surface
instead.
2020-02-06 09:38:25 +01:00
Alexander Larsson
410541f82b Rename GtkIcon to GtkIconPaintable 2020-02-04 17:19:22 +01:00
Benjamin Otte
138de60ab2 icontheme: Remove GENERIC_FALLBACKS
Instead, rely on people passing fallbacks explicitly.

Alternatively, GThemedIcon provides the functionality to create
fallbacks, which is what GtkImage and the testsuite now use.
That method is slightly better, too, so the expected test results
have been updated accordingly.
2020-02-04 16:51:54 +01:00
Benjamin Otte
571021cbc1 icontheme: Pass fallbacks as optional argument to lookup_icon()
This way, we can remove gtk_icon_theme_choose_icon() completely.
2020-02-04 16:51:54 +01:00
Benjamin Otte
bbbe39fb44 icontheme: Make text direction a lookup argument
Most users were just forgetting to set the proper flags.
And flags aren't the right way to set this anyway, it was just
acceptable as a workaround during GTK3 to not break API.
2020-02-04 16:41:36 +01:00
Benjamin Otte
bfebc2b01a icontheme: Remove gtk_icon_theme_get_default()
The API encouraged wrong usage - most of the users were indeed wrong.

Use the correct version instead:
  gtk_icon_theme_get_for_display (gtk_widget_get_display ())
2020-02-04 16:41:36 +01:00
Alexander Larsson
5f8c2b52c6 indentation: fix various alignment issues
Most of these stem from the GtkIconInfo -> GtkIcon rename
2020-01-30 12:27:15 +01:00
Alexander Larsson
27799ba4f5 Remove final references to "icon info" with just "icon" 2020-01-30 10:53:43 +01:00
Alexander Larsson
b087f9ca51 icon-theme: Drop the _for_scale() versions and always take scale 2020-01-30 10:53:43 +01:00
Alexander Larsson
e2f778602b icon-theme: Rename GtkIconInfo to GtkIcon 2020-01-30 10:53:43 +01:00
Alexander Larsson
c42977af04 Convert trivial users of icon theme loading to use info as paintable 2020-01-29 19:06:16 +01:00
Matthias Clasen
2ee087f25f iconbrowser: Use GDK content formats api 2020-01-08 18:48:22 -05:00
Matthias Clasen
bf98ebcb12 iconbrowser: Use gtk_widget_add_controller for drag source 2020-01-08 18:48:21 -05:00
Matthias Clasen
e8b830a3dd dragsource: Reshuffle api a bit
Remove arguments from the constructor.

For actions, we now default to COPY, which is the most common one
that we should enable by default (MOVE requires handling deletion
on the the source side, and ASK only makes sense if we have
multiple actions).

For the content provider, we add a new ::prepare signal where
it should be provided just-in-time.
2020-01-08 18:48:21 -05:00
Matthias Clasen
38974d7d2b dragsource: Tweak api, update all callers
Add GdkDrag back to signals, drop ::drag-data-delete,
and replace it with a boolean in ::drag-end.
2020-01-08 18:48:21 -05:00
Matthias Clasen
993d6388ee iconbrowser: Port to GtkDragSource 2020-01-08 18:48:19 -05:00
Timm Bäder
fd16ac4d5e icontheme: Return paintables from more API 2019-09-09 17:36:26 +02:00
Дилян Палаузов
6ded38de2b Minor typos in the Documentation (a/an) 2019-08-25 12:52:46 +00:00
Matthias Clasen
e2d821fa59 icon-browser: Left-align the sidebar
The centered labels just look disorderly.
2019-04-16 21:00:47 -04:00
Matthias Clasen
8d001e3573 icon-browser: Recover from GtkDialog api change
When we moved content_area to a sibling of action area,
it changed orientation from vertical to horizontal.
Adapt to this change.
2019-04-16 20:59:57 -04:00
Matthias Clasen
69d4081ff8 Merge branch 'wip/ebassi/grid-layout' into 'master'
Implement GtkGridLayout

See merge request GNOME/gtk!714
2019-04-05 02:42:55 +00:00
Emmanuele Bassi
31b65e6721 demos: Update GtkGrid definitions in UI files 2019-04-05 00:12:26 +01:00
Carlos Garnacho
edccf89020 icon-browser: Drop usage of gtk_search_bar_handle_event()
Make it capture key events from the toplevel.
2019-04-03 13:23:34 +02:00
Matthias Clasen
998c1f83a6 icon-browser: Rename to org.gtk.IconBrowser4 2019-04-02 00:27:33 +00:00