Commit Graph

236 Commits

Author SHA1 Message Date
Matthias Clasen
ca6642deed Drop some unnecessary includes 2023-02-18 23:42:04 -05:00
sunce
b13f05537b Escape GtkBuilder XML tag in comment with backtick
Escape XML tags in gi-docgen oriented comment e.g. from <child> to
`<child>`, so that they don't become HTML tag on the final webpage.
This fix includes everything from commit ff46ea64 and #5312.

Fixes #5312
2023-01-15 16:55:18 +08:00
Cam Cook
dd780b3ce0 | domain | current | suggestion |
|--------|---------|------------|
| [GtkHeaderBar](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkheaderbar.c#L780) | "specifies a icon" | "specifies an icon" |
2022-11-27 06:49:40 -05:00
Matthias Clasen
e499a09759 Drop gtkintl.h
Include gtkprivate.h for I_() and glib-i18n.h for
gettext macros.
2022-09-24 10:03:37 -04:00
Sophie Herold
a546ae32d7 Remove all nicks and blurbs from param specs
Those property features don't seem to be in use anywhere.
They are redundant since the docs cover the same information
and more. They also created unnecessary translation work.

Closes #4904
2022-05-11 18:16:29 +02:00
Bilal Elmoussaoui
e6afe28de5 headerbar: Fix docs 2022-03-03 08:36:33 +00:00
Matthias Clasen
610ba1cadf headerbar: Cosmetics
Use the box api we have.
2021-09-24 08:54:04 -04:00
Matthias Clasen
91f7b9663f gtk: Clean up docs syntax
Replace leftover gtk-doc syntax (#Type) with backquotes.
2021-05-22 17:25:26 -04:00
Matthias Clasen
4a0d3d7acc docs: Reduce redundancy
Remove a boatload of "or %NULL" from nullable parameters
and return values. gi-docgen generates suitable text from
the annotation that we don't need to duplicate.

This adds a few missing nullable annotations too.
2021-05-20 20:45:06 -04:00
Matthias Clasen
7fe0610b68 introspection: Stop using allow-none
allow-none has been deprecated for a long time
already. Instead use optional and nullable everywhere.
2021-05-20 19:17:49 -04:00
Matthias Clasen
8ba16eb4f1 Documentation fixes
Mostly fixing up indentation of continuation lines,
and other small cleanups.
2021-05-20 19:17:49 -04:00
Matthias Clasen
7a60c66940 headerbar: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
6ab8ca4669 headerbar: Add example image 2021-03-11 16:37:34 +00:00
Matthias Clasen
1f06cfd5d8 headerbar: Convert docs 2021-03-11 16:37:33 +00:00
Emmanuele Bassi
e8b6e6cad0 docs: Clean up the first paragraph for various symbols
The documentation engine will use the first paragraph as the summary for
a type or constant.
2021-03-11 16:37:30 +00:00
Alexander Mikhaylenko
cf61d96188 headerbar: Null-check boxes when removing window controls
Prevent a crash when show-title-buttons value changes to FALSE during
destruction.
2021-02-08 18:46:35 +05:00
Alexander Mikhaylenko
319755662f headerbar: Don't use gtk_widget_unparent() with GtkBox
gtk_widget_unparent() is for widget implementations, it's not supposed to
be used from outside.
2021-02-08 18:46:27 +05:00
Alexander Mikhaylenko
fd073deea9 headerbar: Prepend start window controls instead of appending
Make sure they are always in the correct position.
2021-01-06 22:04:55 +05:00
Jonas Ådahl
8f8c5040db gtk/headerbar: Remove unused 'state' field 2020-12-07 20:37:30 +01:00
Sophie Herold
fed734edfc Fix some nullable return annotations 2 2020-11-24 19:27:33 +01:00
Emmanuele Bassi
08d59d3f68 docs: Add "Accessibility" section to various widgets
There are a few widgets that gained an accessible role, which means
adding an "Accessibility" section in their description.
2020-11-12 00:36:32 +00:00
Emmanuele Bassi
40c0826921 a11y: Mark more containers as structural elements
Widgets that just provide grouping and layout to other widgets should
not be relevant to the accessible tree.
2020-11-11 18:33:15 +00:00
Benjamin Otte
8dad615f04 gtk: Remove unused header include
gtkcssnodeprivate.h was mainly used for repositioning CSS nodes in
gadgets, and gadgets are gone now.
2020-10-20 04:50:12 +02: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
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
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
Matthias Clasen
54deed9a5a headerbar: Drop the Private struct 2020-07-25 07:41:05 -04:00
Benjamin Otte
d375dce9f5 Replace "gchar" with "char" 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
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
c7b7d78ae1 headerbar: Derive from GtkWidget 2020-05-11 22:38:21 -04:00
Matthias Clasen
d59d9d4bd5 headerbar: Add gtk_header_bar_remove
This is a replacement for gtk_container_remove.
2020-05-11 22:21:39 -04:00
Matthias Clasen
495b9caf63 headerbar: Don't clean up other widget children
The parent of the title_widget is the center box,
it needs to call gtk_widget_unparent on it.
2020-05-11 14:25:57 -04:00
Alexander Mikhaylenko
8ca1e0ddc3 headerbar: Include GtkWindowHandle
This allows it to continue being draggable when placed inside a window, and
will allow to remove the corresponding gestures from GtkWindow.
2020-05-07 23:58:16 +05:00
Alexander Mikhaylenko
4135276252 headerbar: Use GtkCenterBox internally
This will allow to easily wrap it into another widget in the next commits.
2020-05-07 23:58:16 +05:00
Alexander Mikhaylenko
ab59562170 headerbar: Document GtkBuilder child types, add a title example 2020-05-01 21:39:32 +05:00
Alexander Mikhaylenko
739f681076 headerbar: Rename custom-title to title-widget
Now that all the other title-related properties are gone, custom title can
have a more mundane name.
2020-05-01 20:11:19 +05: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
Alexander Mikhaylenko
5321f8f195 headerbar: Use GtkWindowControls
Now that the title buttons are encapsulated in a separate widget, use
it in the header bar.

Hide them when empty, so that they don't add extra spacing.
2020-04-26 15:13:15 +05:00
Alexander Mikhaylenko
2791c522d8 headerbar: Remove decoration-layout-set property
It's unnecessary and only complicates the API. Use decoration-layout if
it's not NULL, and GtkSettings otherwise.
2020-04-24 23:54:07 +05:00
Alexander Mikhaylenko
18114bafe0 headerbar: Remove title button separators
They have had opacity: 0 for a while, just remove them.
2020-04-24 23:54:07 +05:00
Alexander Mikhaylenko
610d5794ac headerbar: Update window buttons automatically
Update the layout when any of the following properties changes:
 * modal
 * transient-for
 * resizable
 * deletable

Stop updating it from GtkWindow, make that function static.
2020-04-23 19:26:10 +05:00
Alexander Mikhaylenko
451c3279ee window: Introduce actions for window buttons
Add the following actions:
 * window.close
 * window.toggle-maximize
 * window.minimize

Ensure they are disabled when not appropriate, such as for modal windows.

Use them in GtkHeaderBar.
2020-04-22 23:01:12 +05:00
Alexander Mikhaylenko
016eac0645 header-bar: Track window icon changes
Listen to icon-name changes if it's in a GtkWindow. This allows to remove a
special case for headerbar-as-titlebar from GtkWindow.
2020-04-22 23:01:12 +05:00
Alexander Mikhaylenko
cead405831 header-bar: Don't assume there's only one icon
Instead of tracking the titlebar icon widget, and updating it when the icon
changes, update the window buttons completely.
2020-04-22 23:01:12 +05:00
Alexander Mikhaylenko
2240eb5c99 header-bar: Stop showing application menu
The application menu isn't particular relevant anymore, and the support for
showing fallback appmenu as a headerbar icon is one of the things tying
GtkWindow to GtkHeaderBar.

Remove support for "menu" window decoration element completely, update
GtkHeaderBar docs.
2020-04-22 21:30:19 +05:00
Matthias Clasen
b55195fa2e Move the idle sizer to GtkWindow
This was only living in gtkcontainer.c for historic
reasons. Move it closer to where it belongs, and
rename it from 'idle' to 'layout', since it is
really about the layout phase of the frame clock,
nowadays.
2020-04-20 16:30:45 -04:00
Matthias Clasen
6edff8cd67 gtk: use toplevel state getter 2020-03-12 14:56:20 -04:00