Timm Bäder
93122ac935
menu: Remove unused members
2019-10-12 17:59:23 +02:00
Timm Bäder
f9e100cb1e
menu: Remove menu_queue_resize
...
The have_layout flag is unused, so this is equal to a normal
gtk_widget_queue_resize().
2019-10-12 17:59:23 +02:00
Timm Bäder
f4f060c843
snapshot: Don't move shadows too much
...
dx/dy are relative to the node bounds, which are already moved by x/y.
2019-10-11 13:47:40 +02:00
Christian Hergert
c7a5d99286
textview: use gtk_snapshot_new_with_parent()
...
As recommended by Timm Bäder at:
3b959456ac (note_621655)
2019-10-09 12:56:06 -07:00
Christian Hergert
e4a00f864d
textview: fix off-by-one in y_range invalidation
...
Previously, with selection bounds, we could have a state where a line
display with selections set would eroniously stay in the cache. This
aggresively releases those at the boundary cases fixing deselection
drawing state.
2019-10-09 10:43:34 -07:00
Timm Bäder
c23afb2c86
widget: Compare adjusted sizes in size_allocate
2019-10-09 16:57:22 +02:00
Timm Bäder
e5de03144f
inspector: Don't add padding to spinbuttons
...
That looks stupid.
2019-10-09 16:57:22 +02:00
Timm Bäder
e325f65c8a
spinbutton: Fix adjustment value thinko
...
Using ints here is wrong as it makes it impossible to e.g. edit a double
in the [0; 1] range.
2019-10-09 16:57:22 +02:00
Timm Bäder
2a40ff1b47
Adwaita: add statusbar padding back
...
We removed the widget margins from the ui file over 2 years ago.
2019-10-09 16:57:22 +02:00
Timm Bäder
371c325ed1
statusbar: Use a bin layout
2019-10-09 16:57:22 +02:00
Timm Bäder
3d3525a589
stacksidebar: Inherit from GtkWidget
...
The child widgets are completely managed by the stacksidebar itself, so
this has no business being a GtkBin.
2019-10-09 16:57:22 +02:00
Timm Bäder
553c458e5a
Adwaita: Remove superfluous border from stacksidebar
...
We already get a border from .sidebar
2019-10-09 16:57:22 +02:00
Timm Bäder
172f68e77d
popovermenu: Switch to main submenu before mapping
2019-10-09 16:57:22 +02:00
Timm Bäder
fb1145d72d
popovermenu: Only close if there's a new focus widget
...
Makes sense and otherwise we end up closing the popover for no reason
2019-10-09 16:57:22 +02:00
Timm Bäder
bd9687a4f2
popovermenu: Switch back to "main" AFTER unmapping
...
Otherwise we might set things to child visible etc. while being
unmapped, which is a violation of the widget invariants of these
properties.
2019-10-09 16:57:22 +02:00
Timm Bäder
49887d4c81
filechooserbutton: Only destroy existing native dialogs
2019-10-09 16:57:22 +02:00
Timm Bäder
d8c940325c
widget: Create finalize assertions in destroy()
2019-10-09 16:57:22 +02:00
Timm Bäder
a3cef6c05e
label: Use TRUE/FALSE instead of 1/0
2019-10-09 16:57:22 +02:00
Timm Bäder
11ee72fc7e
dialog: Fix action button rearrangement
...
The gtk_widget_get_parent() check does not work anymore since the
headerbar adds the buttons to a child box.
2019-10-09 16:57:22 +02:00
Timm Bäder
355d3f070a
widget: Plug layout manager leak
2019-10-09 16:57:22 +02:00
Timm Bäder
b5b81dea7f
modelbutton: Rework
...
Create all the widgets on demand and use a box layout to arrange them
instead of manual size allocation.
Also don't inherit from GtkButton
2019-10-09 16:57:21 +02:00
Timm Bäder
5803366f7d
button: Remove unused signal enum members
2019-10-09 16:57:21 +02:00
Timm Bäder
d3fc47e149
modelbutton: Use a box layout
2019-10-09 16:57:21 +02:00
Timm Bäder
b8f37da911
modelbutton: Replace map() with root()
2019-10-09 16:57:21 +02:00
Timm Bäder
722f8e825e
modelbutton: Remove end_box
...
it's unused.
2019-10-09 16:57:21 +02:00
Timm Bäder
a743412c58
modelbutton: Create accel label on demand
2019-10-09 16:57:21 +02:00
Timm Bäder
a6f14555d1
Adwaita: Blue check/radiobuttons
...
Align with 3.24.
2019-10-09 16:57:21 +02:00
Feichtmeier
1c091a03f3
Tiny refactoring
...
- use checkradio_fg_color for check/radio in treeview, which points to fg_color, so no change of the hex color, thus no change to the parsed CSS
2019-10-09 16:57:21 +02:00
frederik.feichtmeier
2dfb8de0ec
Adwaita: Add color defines from 3.24
2019-10-09 16:57:21 +02:00
Jakub Steiner
876e256f94
Adwaita: make links in infobars legible
...
- No longer tinted blue, make legible
Fixes https://gitlab.gnome.org/GNOME/gnome-software/issues/751
2019-10-09 16:57:21 +02:00
Timm Bäder
eb834b8370
adwaita: Use border-spacing to style checkbuttons
2019-10-09 16:57:21 +02:00
Timm Bäder
dbabdf8341
radiobutton: Fix a warning in a code sample
2019-10-09 16:57:21 +02:00
Timm Bäder
703fda3be8
label: Remove set_selectable_hint
...
It's just updating the cursor, so do it via update_cursor()
2019-10-09 16:57:21 +02:00
Timm Bäder
2f6d6f2473
label: Remove gtk_label_realize
...
We don't need this to update the cursor anymore.
2019-10-09 16:57:21 +02:00
Timm Bäder
3f3c8436c5
label: Don't update cursor after unsetting select_info
...
update_cursor() doesn't do anything in the priv->select_info == NULL
case.
2019-10-09 16:57:21 +02:00
Timm Bäder
d8b0a78c1e
label: Change cursor even if unrealized
...
Cursor don't depend on that anymore.
2019-10-09 16:57:20 +02:00
Timm Bäder
013538daf9
placesviewrow: popup-menu returns a boolean
2019-10-09 16:57:20 +02:00
Christian Hergert
3b959456ac
textview: cache paragraph render nodes
...
We can avoid recreating a number of text nodes from render_para() on
sub-sequent runs if we cache the rendernode instead of just the
PangoLayout.
When used with GtkSourceMap, this can yield a ~7 FPS improvement during
smooth scrolling at the cost of some more memory.
2019-10-08 11:44:27 -07:00
Sam Hewitt
83eeeb6a19
Adwaita: circular button fix
...
- remove old border drawing code that was breaking coloured buttons
- fixes #2173
2019-10-07 16:50:34 -04:00
Sam Hewitt
6db181980a
Adwaita: osd button fixes
...
- remove text/icon shadow from osd buttons
- use :only-child to get circular standalone button
- fixes #1696
2019-10-07 15:27:55 -04:00
Sam Hewitt
023bb2c984
Adwaita: use borders_color for separators
...
- fixes #2175
2019-10-07 13:05:12 -04:00
Benjamin Otte
a3cfb42888
eventcontrollerkey: Change behavior of contains-focus
...
contains-focus now returns TRUE when is-focus is TRUE instead of FALSE.
Fixes #2184
2019-10-07 04:49:50 +02:00
Benjamin Otte
578dc9e70b
eventcontrollerkey: Add getters for the properties
...
...and use them.
2019-10-07 04:49:50 +02:00
Benjamin Otte
6769db160d
icontheme: Don't try to scale pixbufs to 0px
...
Always insist on at least 1px, even if the thumbnail we're turning into
an icon was 256 * 3 and should be scaled to 32 * 3/8.
2019-10-07 04:49:50 +02:00
Benjamin Otte
56d16aae42
selectionmodel: Remove doubled semicolon
2019-10-07 04:49:50 +02:00
Daniel Boles
98f0d85c4a
Builder: Fix a couple of typos in documentation
2019-10-06 20:48:10 +01:00
Christian Hergert
fea2a82ef6
textview: use GtkTextViewChild for border and overlay children
...
This creates a new GtkTextViewChild that can manage overlay children at
given x,y offsets in buffer coordinates. This simplifies GtkTextView by
extracting this from GtkTextWindow as well as providing a real widget for
the borders.
With this change, we also rename gtk_text_view_add_child_in_window() to
gtk_text_view_add_overlay(). For those that were using
GTK_TEXT_WINDOW_WIDGET, they can use a GtkOverlay. It does not appear
that anyone was using GTK_TEXT_WINDOW_(LEFT|RIGHT|TOP|BOTTOM) for widgets
in this fashion, but that can be done by setting a gutter widget with
gtk_text_view_set_gutter(). We can make GtkTextViewChild public if
necessary to simplify this should it become necessary.
GtkTextViewChild will setup a CSS node of either "text" or "border"
depending on the GtkTextWindowType.
The old GtkTextViewChild has been renamed to AnchoredChild as it is only
used for widgets with anchors in the GtkTextBuffer. This also removes the
use of allocated GSList and instead embeds a GQueue and GList to save a
few extraneous allocations.
2019-10-04 14:45:43 -07:00
Christian Hergert
8373cc6c47
textview: revert renaming of buffer_to_surface_coords()
...
The renaming of this function doesn't make much since because the window
is the GtkTextWindowType, not GdkWindow specifically. So we can keep the
old name which is closer to the proper meaning and less code for consumers
to change when porting to 4.x.
2019-10-04 13:22:49 -07:00
Matthias Clasen
872d2046fd
Merge branch 'list-box-headers' into 'master'
...
Fix reuse of list box header widgets
See merge request GNOME/gtk!1114
2019-10-04 18:27:05 +00:00
Sam Hewitt
44ec142fa9
Adwaita: new levelbar style
2019-10-04 14:16:11 -04:00
Philip Withnall
b70f389b64
gtklistbox: Only unparent header rows if they haven’t been reused
...
It’s possible for code which uses a `GtkListBox` to reuse a single
header row, and move it around between rows. For example, this might
happen if the code has interactive widgets (like buttons) in the row,
and doesn’t want to continually recreate them and reattach signals to
them whenever the row headers change.
Unfortunately, this was broken, as the old header widget was
unconditionally unparented, even if it had just been set as the header
for a different row in the same `GtkListBox`. This left it assigned as
a child widget in the `GtkListBox` (so it was iterated over by
`forall`), but without its parent widget set.
Fix that by only unparenting the header if it hasn’t already been
assigned as the parent of a different row.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-10-04 18:48:53 +01:00
Philip Withnall
1c73edd9b0
gtklistbox: Factor the new header out into a separate variable
...
Makes the code a little clearer, but makes no functional changes.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-10-04 18:48:51 +01:00
Christoph Reiter
94d9088034
Print a warning if GTK_DEBUG is set but gtk isn't built with G_ENABLE_DEBUG
...
G_ENABLE_DEBUG is tied to the meson builttype property, so building with "plain"
results in G_ENABLE_DEBUG not being defined and the GTK_DEBUG env var just gets ignored
for that build.
Since it can be confusing that GTK_DEBUG has no effect print a warning message instead.
See #2020 . This is a port of !1109 to master
2019-10-02 21:35:20 +02:00
Rico Tzschichholz
0ad4166482
mediafile: Add g-i annotations for actual return-type of factory methods
2019-09-26 08:19:25 +02:00
Timm Bäder
7ce1055656
eventcontrollerscroll: Events are unhandled by default
...
While the ::scroll signal always returns whether it handled the event,
the others do not, for example ::decelerate.
Previously, this caused the event to stop at a scroll controller with
CAPTURE phase, never emitting the ::decelerate signal on later
controllers with BUBBLE phase.
Fixes #2151
2019-09-25 17:51:53 +02:00
Timm Bäder
78a376aa7f
snapshot: Try to avoid some linear gradient nodes
2019-09-25 17:51:52 +02:00
Timm Bäder
43f2b47fc9
searchentry: Use a box layout
2019-09-25 17:51:52 +02:00
Timm Bäder
413cfed7d7
searchentry: Use edit-clear-all-symbolic as clear icon
...
Fixes #2109
2019-09-25 17:51:52 +02:00
Timm Bäder
1b4bce4182
fontchooserwidget: Use a bin layout
2019-09-25 17:51:52 +02:00
Timm Bäder
387587dedb
colorbutton: Use a bin layout
2019-09-25 17:51:52 +02:00
Timm Bäder
5d8c8f33c0
dialog: Remove useless gtk_widget_show() call
2019-09-25 17:51:52 +02:00
Timm Bäder
d032396031
filechooserbutton: Add icon to default (None) combo box item
...
See #2118
2019-09-25 17:51:52 +02:00
Timm Bäder
12438b30a0
filechooserbutton: Remove priv->child
...
We never use it except when updating the state flags, but we can as well
do that for both children.
2019-09-25 17:51:52 +02:00
Timm Bäder
ea1ff9c482
filechooserbutton: Remove an outdated comment
...
The path used is wrong but the string isn't used in the testsuite
anyway.
2019-09-25 17:51:52 +02:00
Timm Bäder
8122156e84
scrolledwindow: Remove set_placement_internal()
...
set_placement() does the exact same thing.
2019-09-25 17:51:52 +02:00
Timm Bäder
991f4ed993
menubar: Use a box layout
2019-09-25 17:51:51 +02:00
Timm Bäder
29244c5c40
video: Use a bin layout
2019-09-25 17:51:51 +02:00
Timm Bäder
ca3d855c44
levelbar: Use a bin layout
2019-09-25 17:51:51 +02:00
Timm Bäder
7de076481e
headerbar: Fix end-packed child order
...
We pack from right to left there.
2019-09-21 09:41:53 +02:00
Matthias Clasen
b14b0efefe
toolbar: Use a popover for overflow
...
We are phasing out menus.
This is not quite complete, toolitems still
create menuitems, which we translate on the fly.
2019-09-16 17:30:47 -04:00
Matthias Clasen
1b271f3335
notebook: Use a popover for the tab menu
...
We are phasing out menus.
2019-09-16 17:30:47 -04:00
Matthias Clasen
03e30431a8
menutoolbutton: Add support for popovers
...
Just like the underlying menu button, support
popovers too.
2019-09-16 07:24:59 -04:00
Matthias Clasen
5a93449b89
window: Make fallback menu a popover
...
We want to phase out menus.
2019-09-16 07:23:17 -04:00
Matthias Clasen
222e05c2d2
Remove unused includes
...
Don't include gtkmenu.h in places where
it isn't used anymore.
2019-09-16 07:23:17 -04:00
Matthias Clasen
c0071a0676
text util: Remove an unused function
...
_gtk_text_util_append_special_char_menuitems was not used.
2019-09-15 15:01:45 -04:00
Rico Tzschichholz
97231ca231
gtk: Fix some g-i annotation warnings
2019-09-15 17:57:28 +02:00
Rico Tzschichholz
67bd28eaaf
gtk: Fix parameter annotations for gtk_buildable_parse_context_get_position
2019-09-15 17:57:28 +02:00
Rico Tzschichholz
51b2fd1777
build: gtkbuilderparser.c contains g-i annotations for public API
2019-09-15 17:57:28 +02:00
Matthias Clasen
ff5eac6da5
Merge branch 'wip/rah/screensaver-active-fix' into 'master'
...
gtkapplication-dbus: Initialise screensaver-active property
See merge request GNOME/gtk!1091
2019-09-15 15:54:08 +00:00
Christian Hergert
7927f7a440
textview: clip to text window when drawing
...
When drawing the GtkTextView text, we need to clip to the visible area
so that we do not risk drawing under the border windows.
2019-09-13 16:44:04 -07:00
Christian Hergert
605284bc36
textview: fix textview drawing in presence of gutters
...
When drawing a left or top gutter, we need to adjust the origin of the
text snapshot or we risk the gutter drawing above the text.
2019-09-13 16:02:28 -07:00
Timm Bäder
54ed31ebaf
notebook: Use a box layout
...
And incidentally make the CSS node docs correct again.
2019-09-13 19:21:04 +02:00
Timm Bäder
6320bd5849
fontbutton: Shorten clear_font_data a bit
2019-09-13 19:21:02 +02:00
Timm Bäder
86cc7f6925
fontbutton: Use a bin layout
2019-09-13 11:53:24 +02:00
Timm Bäder
adb77e1a92
appchooserdialog: Remove unnecessary gtk_widget_show() calls
2019-09-13 11:39:34 +02:00
Timm Bäder
097f3c9514
headerbar: Remove spacing property
...
Replace it with border-spacing in css
2019-09-13 11:07:56 +02:00
Timm Bäder
519967cc69
headerbar: Use a center layout
...
Get rid of the custom title centering etc. and use a GtkCenterLayout.
Use a box on the start/end to manage the child widgets.
2019-09-13 11:07:56 +02:00
Timm Bäder
a7b9a33efc
Add GtkCenterLayout
...
And use it in GtkCenterBox, different widgets following.
2019-09-13 11:07:54 +02:00
Timm Bäder
32b84b8ab6
native: Don't compare a pointer with 0
...
We have NULL for that.
2019-09-11 08:12:31 +02:00
Timm Bäder
8ec1c866e1
widget: Inline build_finalize_assertions into only caller
2019-09-11 08:12:31 +02:00
Timm Bäder
3a06394fde
headerbar: Don't update window buttons when unrealized
...
It doesn't make much sense in that case and we will update them again
when realizing.
2019-09-11 08:12:31 +02:00
Timm Bäder
ce72154913
Rename gtkbookmarkmanager.h to gtkbookmarksmanagerprivate.h
...
It's a private type, so gets a private header file name.
2019-09-11 08:12:31 +02:00
Timm Bäder
ed11f2a9e4
bookmarksmanager: Stop exporting get_xdg_type
2019-09-11 08:12:31 +02:00
Timm Bäder
60f2e452a1
switch: Stop using a private struct
...
Private type, no private struct needed.
2019-09-11 08:12:31 +02:00
Alexander Larsson
76103ee286
GtkBuildable: Fix indentation
2019-09-10 12:08:20 -04:00
Alexander Larsson
73042bfc54
GtkWidget: Precompile template xml on class creation
...
Ideally we will precompile during build and store the result in the
resource, but if that doesn't happen at least we will only parse
the xml once.
2019-09-10 12:08:20 -04:00
Alexander Larsson
ff23397701
GtkBuilder: Add support for precompiling builder xml
2019-09-10 12:08:20 -04:00
Alexander Larsson
96b37f4eb8
Use the new GtkBuildableParser type in GtkBuildable interfaces
2019-09-10 12:08:20 -04:00
Alexander Larsson
135cea76fb
GtkBuildableParser: Add a wrapper for GMarkupParser
...
This currenly just wraps GMarkupParser, but the plan is to expose this
instead of GMarkup in the GtkBuildable interfaces, allowing us to
replace the parser with something that handles pre-parsed input
instead.
Note that we duplicate some of the features of GMarkup to implement
the APIs rather then call down to GMarkup, as we need to support these
in the pre-parsed case anyway.
2019-09-10 12:07:15 -04:00
Matthias Clasen
ff087e126f
Merge branch 'wip/chergert/tune-linedisplay-cache' into 'master'
...
textview: optimize linedisplay cache based on number of visible rows
See merge request GNOME/gtk!1090
2019-09-10 01:42:13 +00:00
Matthias Clasen
9501fc2c14
Merge branch 'nested-popover-menu' into 'master'
...
Nested popover menus
See merge request GNOME/gtk!1076
2019-09-10 01:09:31 +00:00
Timm Bäder
0603b4431a
icontheme: Stop using a private struct
...
The GtkIconTheme/GtkIconInfo structs aren't public anymore, so use the
structs directly instead of a priv pointer.
2019-09-09 17:36:27 +02:00
Timm Bäder
5f48f60a93
Icontheme: Clean up gtk_icon_info_load_async
2019-09-09 17:36:27 +02:00
Timm Bäder
cc9faf3cfa
scrolledwindow: Actually add controller to widget
...
Closes #2127
2019-09-09 17:36:27 +02:00
Timm Bäder
32cec6c1cb
icontheme: Adapt a code sample to the GdkPaintable transition
2019-09-09 17:36:27 +02:00
Timm Bäder
c0827e2c54
pixbufutils: Escape file data only once
2019-09-09 17:36:27 +02:00
Timm Bäder
1a931da046
pixbufutils: Pass colors as string to load_symbolic_svg
...
We were converting the same colors over and over again to a string, just
to free them again at the end of the function. We know the colors at
compile time however, so don't convert them at all.
2019-09-09 17:36:27 +02:00
Timm Bäder
8eb62f138b
pixbufutils: Only get icon size once
...
load_symbolic_svg was loading the pixbuf just to get its size via
gdk_pixbuf_get_{width,height}. However, this function is called in a
loop in gtk_make_symbolic_pixbuf_from_data.
So, do this only once and pass the icon size along to load_symbolic_svg.
2019-09-09 17:36:27 +02:00
Timm Bäder
6a8921ec6b
icontheme: Remove symbolic pixbuf cache
...
We recolor icons on via color matrix nodes these days, so this cache is
basically unused.
2019-09-09 17:36:27 +02:00
Timm Bäder
53132d0235
icontheme: Add LRU cache back
...
Add a cache of icon infos that we keep around a little longer, to avoid
loading icons from disk that only exist for a short amount of time (e.g.
during one frame of a cell renderer snapshot).
We make sure recently used items are kept alive by just adding them to
the cache on lookup.
2019-09-09 17:36:27 +02:00
Timm Bäder
32bed34935
icontheme: Remove GtkIconInfo->pixbuf
...
Create textures as soon as possible.
2019-09-09 17:36:26 +02:00
Timm Bäder
1873b38a94
icontheme: Remove icon_info_load_pixbuf
...
What it does overlaps with the only caller a lot now.
2019-09-09 17:36:26 +02:00
Timm Bäder
38b4a2a8e2
icontheme: Optimize suffix_from_name
...
We call this function a lot, so avoid repeated strlen() calls on @name
and the different suffixes.
2019-09-09 17:36:26 +02:00
Timm Bäder
b65d9ca955
icontheme: Avoid creating useless IconThemeDirs
...
We were allocating IconThemeDir instances and then only later assign a
value to has_icons. In the !has_icons case, we were directly throwing
the IconThemeDir away again.
Delay allocating the IconThemeDirs until we know that it has icons.
This avoids allocating and then de-allocating around 1400 IconThemeDir
instances when opening the widget-factory.
2019-09-09 17:36:26 +02:00
Timm Bäder
0b472c23d7
icontheme: Inline scan_resources into only caller
...
The previous code was hiding the fact that the scan_resources function
almost always did nothing and just used g_resources_enumerate_children()
and then returned FALSE, leaving the caller with cleaning up the already
allocated IconThemeDir. By inlining this, we make sure that calling code
does not even need to allocate the IconThemeDir.
2019-09-09 17:36:26 +02:00
Timm Bäder
bb89ee184f
icontheme: Remove proxy pixbufs
...
These were only used for the LRU cache.
2019-09-09 17:36:26 +02:00
Timm Bäder
eb087c9943
icontheme: Remove lru cache
...
We will replace it with something else later
2019-09-09 17:36:26 +02:00
Timm Bäder
eeec6f8fb9
icontheme: Annotate return value as nullable
2019-09-09 17:36:26 +02:00
Timm Bäder
71339225eb
icontheme: Remove gtk_icon_info_load_texture
...
It's the same as load_icon now.
2019-09-09 17:36:26 +02:00
Timm Bäder
590e70d4d1
icontheme: Return a paintable from gtk_icon_info_load_icon
2019-09-09 17:36:26 +02:00
Timm Bäder
fd16ac4d5e
icontheme: Return paintables from more API
2019-09-09 17:36:26 +02:00
Timm Bäder
f3099afcc5
icontheme: Return textures from load_icon{,_for_scale}
2019-09-09 17:36:26 +02:00
Timm Bäder
e0fe2882ad
icontheme: Don't try to scale pixbufs to same size
2019-09-09 17:36:26 +02:00
Timm Bäder
4413592a70
recentmanager: Stop using linked lists
...
It doesn't really make sense to save the applications and groups in
recent infos as linked lists. We get them from glib as arrays, so we can
as well just save them as such.
2019-09-09 17:36:26 +02:00
Timm Bäder
4c28ee80a6
filechooserwidget: Create recent manager when setting operation mode
...
Creating a recent manager can be fairly expensive and we won't use it if
the widget is not visible or the recent mode has not been entered. Code
other places can already handle a NULL recent manager, so just create it
when entering the recent mode. And shove 25ms of startup time off the
widget-factory this way.
2019-09-09 17:36:26 +02:00
Timm Bäder
f4c4fe860b
filechooserwidget: Remove custom recent_info_has_application impl
2019-09-09 17:36:26 +02:00
Timm Bäder
4766b475d0
filechooserwidget: Inline come functions into only callers
...
Similar to the previous commit(s), make it clearer what this function
does.
2019-09-09 17:36:26 +02:00
Timm Bäder
ae75d4b565
filechooser: Move extract_recent_folders to filechooserwidget
...
It's not used anywhere else.
2019-09-09 17:36:26 +02:00
Timm Bäder
c102387916
filechooserwidget: Load recent files synchronously
...
Delaying this by one frame by putting it in an idle just makes the code
more complex for no gain. The actual slow part is reading the
recently-used.xbel, which happens when creating the recent manager.
2019-09-09 17:36:26 +02:00
Timm Bäder
86ad215deb
recentmanager: Indentation
2019-09-09 17:36:26 +02:00
Timm Bäder
2ffbb37783
icontheme: Annotate return value of load_icon as nullable
...
It returns NULL in the error case.
2019-09-09 17:36:26 +02:00
Timm Bäder
6821fe0c13
icontheme: Add error argument to _load_texture
...
Loading an icon might fail.
2019-09-09 17:36:26 +02:00
Timm Bäder
a0947232fa
icontheme: optimize icon_uri_is_symbolic as well
2019-09-09 17:36:26 +02:00
Timm Bäder
e3f1a3d27c
main: Check if any debug flags are set in gtk_get_debug_flags()
...
We end up checking the debug flags for the default display, but that's
unnecessary if we know that no display has any debug flags set anyway.
2019-09-09 17:36:26 +02:00
Timm Bäder
d98e05b91a
icontheme: Save the min_suffix for the min_dir
...
We already have to compute that value in the loop before, so just save
it.
2019-09-09 17:36:26 +02:00
Timm Bäder
fa85f4fc2e
icontheme: Remove use_builtin parameter from theme_lookup_icon
...
Unused.
2019-09-09 17:36:26 +02:00
Timm Bäder
44352b375e
icontheme: Remove paramter from get_icon_suffix
...
Turns out nobody care about that one.
2019-09-09 17:36:26 +02:00
Timm Bäder
ebe88ea322
icontheme: Optimize icon_name_is_symbolic
...
We call this function *a lot* it's doing lots of unnecessary work inside
g_str_has_suffix. Get the icon name length only once instead and
open-code the suffix check.
2019-09-09 17:36:26 +02:00
Timm Bäder
6d77723fe0
gtkicontheme: Avoid a get_icon_flags call
...
We're only using the value of the first call at all if
symbolic_suffix & ICON_SUFFIX_PNG is FALSE.
2019-09-09 17:36:26 +02:00
Timm Bäder
c5ed51a188
icontheme: Remove outdated comment
...
It's not called css_fg anymore and it can't possibly be NULL since we
make sure before passing it here.
2019-09-09 17:36:25 +02:00
Timm Bäder
1339c425a8
widget: Queue an allocate on native widgets when changing opacity
...
This way the opacity change works on toplevel windows on wayland.
2019-09-09 17:36:25 +02:00
Timm Bäder
7c723dfc58
inspect-button: Inline deemphasize_window() into only caller
2019-09-09 17:36:25 +02:00
Timm Bäder
72814a8153
inspect-button: Inline some functions into only caller
...
Make them clearer for later commits.
2019-09-09 17:36:25 +02:00
Timm Bäder
9952f72680
filechooserwidget: Properly watch for different display
...
The value returned by gtk_widget_get_settings() depends on the widget's
display, so watch for notify::display instead of using (un)root for
this.
Fixes the warnings seen when show a file chooser from the inspector.
2019-09-09 17:36:25 +02:00
Timm Bäder
cbc3ce5b03
box: Don't do casts before preconditions
2019-09-09 17:36:25 +02:00
Timm Bäder
d223752c55
infobar: Inherit from GtkContainer
...
infobars being a GtkBox doesn't make sense.
Also implement infobars without exposing internal children.
Closes #1957 because it adds the bottom border.
2019-09-09 17:36:25 +02:00
Timm Bäder
74208e9e0c
text: Fix a crash when retrieving the selected text
2019-09-09 17:36:25 +02:00
Timm Bäder
14b7fa1dd6
textview: Remove useless warning
...
The output doesn't make sense anymore and it breaks cursor blinking when
moving the focus back into the textview.
2019-09-09 17:36:25 +02:00
Timm Bäder
4bfe8605cb
layoutoverlay: Fix everything
...
This code is better because:
1) The coordinates translations are actually correct and not sometimes
wrong like before
2) We clip widgets that have overflow set
3) We honor the widget's transform
4) It is less code
2019-09-09 17:36:25 +02:00
Timm Bäder
e86bf764a8
scale: Allocate value close to slider
...
The scale might be allocated at a height greater than requested, and in
that case y=0 is just too far away. Allocate the value directly next to
the slider instead.
2019-09-09 17:36:25 +02:00
Timm Bäder
80411fb905
scale: Use top/left/bottom/right style classes on value label
...
Just top/bottom is not enough anymore.
77769a52b3
broke e.g. horizontal scales
with the value on top/bottom, adding too much space.
2019-09-09 17:36:25 +02:00
Timm Bäder
9166b03c42
fixed: Documentation clarifications
2019-09-09 17:36:25 +02:00
Timm Bäder
31efc882db
fixed: x/y passed to get_child_position are not optional
2019-09-09 17:36:25 +02:00
Timm Bäder
1db59d1c89
fixedlayout: Don't call the child transform position
...
It's a full transform and not just a translation these days.
2019-09-09 17:36:25 +02:00
Timm Bäder
afb3715700
linkbutton: Use widget API to set has-toolip
...
As God intended.
2019-09-09 17:36:24 +02:00
Timm Bäder
6be4279f39
linkbutton: Use proper action name for right-click menu
2019-09-09 17:36:24 +02:00
Timm Bäder
5782871f91
menubutton: Control sensitivity of child button
...
Instead of the menubutton itself.
2019-09-09 17:36:24 +02:00
Timm Bäder
0e9ac9e64b
magnifier: Remove some unused members
2019-09-09 17:36:24 +02:00
Timm Bäder
0821d5b29d
widget: Clear up gtk_widget_class_install_property_action docs
2019-09-09 17:36:24 +02:00
Timm Bäder
b3cffc0516
widget: Remove reference to non-existent function
...
gtk_widget_class_install_stateful_action() does not exist.
2019-09-09 17:36:24 +02:00
Timm Bäder
80a58672d1
widget: Add some missing annotations to gtk_widget_class_query_action
2019-09-09 17:36:24 +02:00
Timm Bäder
18714e25a8
window: Remove useless deprecation guards
...
gtk_window_present() is not deprecated.
2019-09-09 17:36:24 +02:00
Timm Bäder
b29c30c9d5
cssprovider: Remove unused member from GtkCssScanner
2019-09-09 17:36:24 +02:00
Timm Bäder
d8df197489
cssprovider: Don't lookup on empty css providers
...
This should not have a huge performance impact, but debugging is easier
if we don't lookup in empty css providers.
2019-09-09 17:36:24 +02:00
Timm Bäder
514e60c1bb
cssnode: GtkCssAnimatedStyle->style is always a static style
2019-09-09 17:36:24 +02:00
Timm Bäder
32a256bd03
gtksettings: Remove unused functions & prototypes
2019-09-09 17:36:24 +02:00
Timm Bäder
b9316a404a
cssnode: Remove unused struct
2019-09-09 17:36:24 +02:00
Timm Bäder
ea2a3f3e62
cssstyle: Remove unused _add_difference
2019-09-09 17:36:24 +02:00
Timm Bäder
5cd8009c53
stylecontext: Remove leftover function prototypes
2019-09-09 17:36:24 +02:00
Timm Bäder
26aa620efe
stylecontext: Stop exporting _resolve_color
...
Only used in gtkstylecontext.c
2019-09-09 17:36:24 +02:00
Timm Bäder
e0cf6e4775
csscolorvalue: return the initial color value directly
2019-09-09 17:36:24 +02:00
Timm Bäder
df2d43c893
csscolorvalue: Remove unused new_from_rgba()
2019-09-09 17:36:24 +02:00
Timm Bäder
8d6c5ba90e
cssstaticstyle: Compute initial/inherit values directly
2019-09-09 17:36:24 +02:00
Timm Bäder
629f528f6d
cssinitialvalue: Make _compute public
...
So we can use it in cases where the class of css value is known to be an
initial one.
2019-09-09 17:36:24 +02:00
Timm Bäder
191e3bc7e1
csslookup: Remove 'relevant' parameter from _init
...
Unused.
2019-09-09 17:36:24 +02:00
Timm Bäder
ecad4743bd
csslookup: Remove 'missing' bitmask
...
It's almost never useful to have a bitmask here, since it's only used
for the intersection case in gtk_css_style_provider_lookup. However,
even if that returns true, we still need to check every single style
property for being set again in the look afterwards.
Just remove the bitmask.
2019-09-09 17:36:24 +02:00
Timm Bäder
ceb8aedf97
cssanimatedstyle: Keep transition_info_add from recursing
...
The slowest part of that fuction is the type check for
GtkCssShorthandProperty. Subproperties of shorthand properties never
refer to more shorthand properties however, so we don't want to have the
type check for those.
2019-09-09 17:36:24 +02:00
Timm Bäder
0cf4eb379f
csslookup: Remove tautological if expression
...
A value is always either set or missing.
This was changed in a1f7c459b7
, which
removed the ability for partial style computation.
2019-09-09 17:36:24 +02:00
Timm Bäder
f3fdf58ff7
cssstaticstyle: Avoid ref'ing specified value in compute_value
...
There are alerady _get functions for GtkCssInheritValue and
GtkCssInitialValue, so use those. We can avoid a ref+unref pair this
way.
2019-09-09 17:36:24 +02:00
Timm Bäder
3073e65851
cssprovider: Fix compilation wth VERIFY_TREE set
2019-09-09 17:36:24 +02:00
Timm Bäder
a75529f3c0
cssmatcher: Inline node values into matcher
...
So we don't have to go through the matcher->node->decl every time
2019-09-09 17:36:24 +02:00
Timm Bäder
75a48aed0b
cssanimatedstyle: Make set_animated_value transfer-full
2019-09-09 17:36:24 +02:00
Timm Bäder
a7f23ebe7d
cssimage: Use gtk_internal_return_val_*
...
GtkCssImage is not public and being used in hot paths, e.g. CSS.
2019-09-09 17:36:23 +02:00
Timm Bäder
0f9a02e6f4
gtkprivate: Only define gtk_internal_return_if* for consistency checks
...
The wanted behavior here is that these are only defined if the buildtype
is debug, i.e. full debugging.
2019-09-09 17:36:23 +02:00
Timm Bäder
4b4b77ca04
cssanimatedstyle: Save animation in array
2019-09-09 17:36:23 +02:00
Timm Bäder
a231648607
cssanimatedstyle: Avoid type check in loop
...
We can just do the check once as source is not going to change within
the loop.
2019-09-09 17:36:23 +02:00
Timm Bäder
eeb5cd2321
cssanimatedstyle: Avoid unnecessary transition work
...
No need to do all the transition work if the transition duration will be
0 for all of them.
2019-09-09 17:36:23 +02:00
Timm Bäder
5c705ae9a5
cssrgbavalue: Add & use new_white()
2019-09-09 17:36:23 +02:00
Timm Bäder
19f69f6ac8
cssrgbavalue: Add an opaque white singleton
...
Used a few hundred times in the widget-factory.
2019-09-09 17:36:23 +02:00
Timm Bäder
ad1340cab4
cssrgbavalue: Add a singleton for transparent colors
...
The most common background color is no background color.
2019-09-09 17:36:23 +02:00
Timm Bäder
3a3a59c188
cssdimensionvalue: Create a few more common singletons
2019-09-09 17:36:23 +02:00
Timm Bäder
6ed6cc46de
cssstaticstyle: Make set_value (transfer-full)
...
We only call this in one place and we can avoid a ref + unref pair this
way.
2019-09-09 17:36:23 +02:00
Timm Bäder
6837e80d14
css: Avoid more type checks in hot paths
2019-09-09 17:36:23 +02:00
Timm Bäder
4f3e65e745
csspalettevalue: Use simple arrays instead of a hashtable
...
Use two sorted name/value arrays to save the colors instead of a
hashtable. This makes palette values faster to compare etc.
2019-09-09 17:36:23 +02:00
Timm Bäder
36a1b69a19
cssanimatedstyle: Remove some casts in hot paths
...
gtk_css_animated_style_create_css_transitions down from 16% to 11%
when repeatedly clicking on a spinbutton button in the widget factory.
2019-09-09 17:36:23 +02:00
Timm Bäder
1f11892de4
bitmask: Add _gtk_allocated_bitmask_to_string
2019-09-09 17:36:23 +02:00
Timm Bäder
1bc8f3ac6e
Adwaita: Hack around list button styling
...
Once again.
2019-09-09 17:36:23 +02:00
Timm Bäder
822547dfef
spinbutton: Use a box layout
2019-09-09 17:36:23 +02:00
Timm Bäder
c0214cfcc1
menubutton: Add a create_popup_func
...
Some use cases require a menu button to create the popup on demand.
2019-09-09 17:36:23 +02:00
Timm Bäder
cb6d96d65f
menubutton: Remove unused member
2019-09-09 17:36:23 +02:00
Timm Bäder
4cc4868e93
label: Remove "line" from wrap properties
...
The property names are "wrap" and "wrap-mode", so it doesn't make sense
that the accessors refer to line_wrap and line_wrap_mode.
2019-09-09 17:36:23 +02:00
Timm Bäder
ffab342fc4
snapshot: Stop exporting _append_node_internal
...
Unused outside of gtksnapshot.c
2019-09-09 17:36:23 +02:00
Matthias Clasen
1203dc501c
popover menubar: Use nested popover menus
...
Make the popover menubar use nested menus, to
better match the expected behavior of traditional
menus.
2019-09-08 19:02:06 -04:00
Matthias Clasen
3cbf1845a9
Add a timeout for open submenus
...
When a popover menu has an open submenu,
delay activating another item until after
the pointer is stationary for a little
while. This avoids the need for precise
horizontal motion when moving towards the
submenu.
2019-09-08 19:02:06 -04:00
Matthias Clasen
ea44eade21
Add nesting popover menus
...
Add a variant of popover menus that are nesting
like traditional menus. This is a better fit for
replacing traditional main menus.
2019-09-08 19:02:06 -04:00
Matthias Clasen
c75a368bab
popover: Support vertical aligment
...
We already support horizontal alignment, and
we should do the same for vertical alignment.
2019-09-08 19:02:06 -04:00
Bob Ham
6bfe171058
gtkapplication-dbus: Initialise screensaver-active property
...
When GtkApplication starts listening to the screensaver's D-Bus
status, the screensaver-active property is not initialised and
applications making use of the property are out of sync until the
first state change. Any application starting when the screensaver is
active will think it's inactive.
To fix this, we set the property when we first start monitoring the
screensaver.
2019-09-06 14:59:27 +01:00
Christian Hergert
5e49da1d73
textview: optimize linedisplay cache based on number of visible rows
...
This tries to estimate the number of visible rows in a textview based on
the default text size and then tunes the GtkTextLineDisplayCache to keep
3*n_rows entries in the cache.
This was found imperically to be near the right cache size. In most cases,
this is less than the number of items we cache now. However, in some cases,
such as the "overview map" from GtkSourceView, it allows us to reach a
higher value such as 1000+. This is needed to keep scrolling smooth on
the larger view sizes.
With this patch, a HiDPI system with a GtkSourceView and GtkSourceMap
from the GTK 4 port can perform smooth scrolling simultaneously.
2019-09-05 19:06:35 -07:00
Christian Hergert
cc7ae525ef
texttag: avoid use of g_signal_emit_by_name()
...
This avoids looking up the signal by name and instead uses the saved
signal identifier from gtktexttagtable.c
2019-09-04 19:39:24 -07:00
Christian Hergert
7cea21043e
textlayout: remove use of GtkTextIter in line comparison
...
We do not need to create a GtkTextIter to perform the comparison here as
that will require a number of validation steps that are extra work
compared to just discovering the GtkTextLine number directly.
2019-09-04 09:12:54 -07:00
nana-4
b9d8eb54b7
Adwaita: Don't inherit font style to popover
...
https://gitlab.gnome.org/GNOME/gtk/issues/2061
2019-09-03 01:43:41 +09:00
nana-4
a2fdb55384
Adwaita: Fix broken osd popover style
...
Apply %osd to child arrow and contents instead of parent popover.
https://gitlab.gnome.org/GNOME/gtk/issues/2061
2019-09-03 01:34:05 +09:00
Alexandre Franke
88b617646a
popover: fix typo in schema string
2019-08-29 14:50:20 +02:00
Matthias Clasen
9bb58c3eca
Merge branch 'office-runner-crash' into 'master'
...
Fix a crash in gtk-builder-tool
See merge request GNOME/gtk!1064
2019-08-26 13:50:43 +00:00
Matthias Clasen
c0b8eb30de
Fix a crash in gtk-builder-tool
...
Crash pointed out by Bastien Nocera.
Testcase included.
2019-08-26 15:34:15 +02:00
Дилян Палаузов
6ded38de2b
Minor typos in the Documentation (a/an)
2019-08-25 12:52:46 +00:00
Timm Bäder
ee27587428
scale: Add a destroy notify to set_format_value_func
...
Closes #2098
2019-08-15 17:21:47 +02:00
Timm Bäder
d2f76d689f
scaler: Avoid some signal connections
...
We're mainly using this for icons that will never change contents or
size, and we're using a GtkScaler per such icon when on a hidpi setup,
so just avoid the two signal connections per icon.
2019-08-15 17:13:29 +02:00
Timm Bäder
20cd6cc155
spinbutton: Use gtk_button_new_from_icon_name
2019-08-15 16:23:01 +02:00
Timm Bäder
960e766206
widget: Don't duplicate events to translate coordinates
2019-08-15 16:23:01 +02:00
Timm Bäder
1c9fbe3773
widget: Remove captured event handler code
2019-08-15 16:23:01 +02:00
Timm Bäder
6669ddad09
scrolledwindow: Stop using _gtk_widget_set_captured_event_handler
...
We can use an event controller with phase = CAPTURE these days.
2019-08-15 16:23:01 +02:00
Matthias Clasen
55839dc508
Merge branch '948-patch-renaming-a-file-can-make-it-to-loose-selection_GTK4' into 'master'
...
filechooser: keep file selected after being renamed
Closes #948
See merge request GNOME/gtk!1053
2019-08-13 21:18:41 +00:00
Matthias Clasen
6dd23b2bf0
text view: Fix a typo
...
Pointed out in https://gitlab.gnome.org/GNOME/gtk/issues/2094
2019-08-13 15:16:03 -04:00
Nelson Benítez León
487e095d24
filechooser: keep file selected after being renamed
...
Because otherwise when the file list is sorted "by name"
and the new name causes the file to be re-sorted to another
row, the selection stays in the old row which is now
occupied by a different file.
Fixed by keeping track of the renamed file and revealing
it in the "row-changed" signal handler, which gets emitted
after a file is renamed.
Fixes issue #948
2019-08-12 17:32:56 -04:00
Timm Bäder
164ebee129
Adwaita: Style spinbutton up/down children explicitly
...
Once again to increase the specificty above that of the
"list row button.etc." selector. Makes hovering spinbutton buttons in
lists look normal again.
2019-08-11 10:41:58 +02:00
Timm Bäder
76f2c4f0aa
Adwaita: Update .devel headerbar styling
...
Just pull in the changes from gtk-3-24
2019-08-11 10:30:01 +02:00
Timm Bäder
9999ac1255
range: Avoid a divison by 0
...
Based on a patch by Blake Latchford
Fixes #618
2019-08-11 10:06:52 +02:00
Daniel Boles
3242174f81
AccelLabel: Add get_accel_closure() accessor
...
Fixes #875
2019-08-11 09:55:43 +02:00
Timm Bäder
6f1cade817
color chooser: Port checkered pattern drawing from cairo
2019-08-11 09:34:50 +02:00
Timm Bäder
c6961f1b61
range: Use public delay-factory API
2019-08-11 09:34:50 +02:00
Timm Bäder
8c88453816
cellrenderer: Add accessors for {get,set}_is_expande{r,d}
2019-08-11 09:34:50 +02:00
Timm Bäder
c812e1dc94
Adwaita: Fix hovering modelbutton arrows
...
This CSS snippet was supposed to only recolor the popover arrow but
ended up also recoloring the > arrow on modelbuttons that show a
submenu. Make the selector more specific.
2019-08-11 09:05:31 +02:00
Timm Bäder
8d1a2247e0
treeview: Redo tree line drawing using textures
...
Gets rid of the remaining cairo nodes used for line drawing.
2019-08-11 09:05:28 +02:00
Timm Bäder
4fba7f8c59
treeview: Redo grid line drawing using textures
...
The cairo pattern in use was simple enough, so just use a 2×1 or 1×2
texture to draw horizontal and vertical grid lines. This avoids a bunch
of cairo nodes (that can't be cached by the renderers).
2019-08-11 09:05:25 +02:00
Timm Bäder
a93745238f
snapshot: Annotate child_bounds parameter of push_repeat as nullable
2019-08-10 19:51:45 +02:00
Timm Bäder
b812ff2597
treeview: Shorten destroy() implementation
2019-08-10 19:51:45 +02:00
Timm Bäder
8a51796150
treeview: Remove two _dashes members
...
Tree lines and grid lines always look the same these days.
2019-08-10 19:51:45 +02:00
Timm Bäder
dd7d171186
treeview: Remove GTK_TREE_VIEW_FOREGROUND_LINE
2019-08-10 19:51:45 +02:00
Timm Bäder
0ac20f978e
spinbutton: Remove an unnecessary queue_draw() call
2019-08-10 19:51:45 +02:00
Timm Bäder
0a96c3f062
scale: Properly update when inverted
...
Just queue_resize()ing the range itself doesn't work as it will just
re-allocate all the child widgets (i.e. just the trough) to its old
position and size.
2019-08-10 19:51:45 +02:00
Timm Bäder
42e6630c3e
scale: Make a function shorter
2019-08-10 19:51:45 +02:00
Timm Bäder
1125d08f0d
range: Remove outdated comment
2019-08-10 19:51:45 +02:00
Mohammed Sadiq
c1bb699151
builderparser: Allow bind-source without bind-property
...
This allow users to bind same property of two objects with only
specifing “name” and “bind-source” in UI file.
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2080
2019-08-10 19:01:36 +05:30
Mohammed Sadiq
55af84d359
widget: Fix a typo in documentation
2019-08-10 12:11:13 +05:30
Christian Hergert
4ae362d138
textview: clear cached entries before releasing containers
...
We want to ensure all of the display cache entries are released in the
normal fashion before releasing the structures so that we can maintain
the invariant that cache_iter will always exist while in the cache.
2019-08-09 12:52:16 -07:00
Timm Bäder
fd201e4df7
treeviewcolumn: Remove cell_area parameter from _cell_get_size
...
Fixes #297
2019-08-09 17:04:58 +02:00
Timm Bäder
21123a1264
iconhelper: Don't snapshot 0 sized icons
...
This is happening for me when snapshotting small thumbnails in the file
chooser. The GtkScaler will scale the 1px height/width by 2, resulting
in nothing being drawn at all.
2019-08-09 15:55:38 +02:00
Timm Bäder
87aeec2b63
scale: Fix value widget measurement
...
Since we set the size request of the label, the later measure()
call would return at least the size we set, making the size only ever
grow.
2019-08-09 14:30:01 +02:00
Timm Bäder
ea5fc348fa
scale: Replace format-value signal
...
There is no reason for this to be a signal, since multiple handlers
don't make sense anyway. It was also broken because the scale needs to
know when a signal handler is added so it can update the value
representation.
Replace the signal with a set_format_value_func function which allows us
to do that.
Fixes #113
2019-08-09 14:30:01 +02:00
Timm Bäder
ebc0d3760f
range: remove range_size_request vfunc
...
It's unneeded in GtkScale and named after the gtk2 size_request function
2019-08-09 14:30:01 +02:00
Timm Bäder
b4a6d69f5d
scale: Allocate left marks next to trough
2019-08-09 14:30:01 +02:00
Timm Bäder
05cdce2e8d
scale: Fix an uninitialized value
2019-08-09 14:30:01 +02:00
Timm Bäder
509b781079
widget: Avoid a few type checks
2019-08-09 14:30:01 +02:00
Timm Bäder
4b7a6a885d
Merge branch 'adwaita-scales-marks-fintune-fix-master' into 'master'
...
Adwaita: Fix fine-tune mode for scales with marks
Closes #1799
See merge request GNOME/gtk!696
2019-08-08 16:41:04 +00:00
Jonas Ådahl
048957cd49
gtk/icon-theme: Handle lack of SVG loader gracefully
...
When loading a SVG icon from a gresource file only containing SVG icons,
but without having a SVG loader available in gdk-pixbuf, we would crash
when trying to eventually load the resource. Fix this by gracefully
handling this by simply failing to load the icon, while the first time
it happens, log a warning.
Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2084
2019-08-08 09:05:30 +02:00
Timm Bäder
434d32bf95
Adwaita: Fix round titlebar button outline radius
...
Fixes #2073
2019-08-07 18:49:50 +02:00
frederik.feichtmeier
1178a0011a
Exclude appmenu titlebuttons
2019-08-07 18:46:50 +02:00
frederik.feichtmeier
0af2e65c80
Make titlebuttons round
...
- use even sides for the titlebuttons so the result is a circle and not an ellipse
- add maximum border radius
- set min width/height to 0
- adjust margin and padding to match the previous look
2019-08-07 18:46:47 +02:00
Timm Bäder
e8f3b47bf3
gesturelongpress: Add getter/setter for delay-factor
2019-08-07 14:11:00 +02:00
Timm Bäder
8b16e44d26
passwordentry: Fix a documentation comment parameter name
2019-08-07 13:12:57 +02:00
Timm Bäder
002abc6d48
placessidebar: Remove popover using gtk_widget_unparent()
...
the gtk_widget_destroy() does not work anymore.
2019-08-06 17:39:01 +02:00
Timm Bäder
aca31c3ab6
adwaita: Increase spinbutton button styling specificity
...
So it trumps the 'toned down' button styling.
Fixes #2012
2019-08-06 17:38:54 +02:00
Matthias Clasen
a3609c3f6d
Merge branch 'implement-choices-file-chooser-native-win32-for-gtk-4' into 'master'
...
Implement choices for GtkFileChooserNativeWin32 [Gtk4]
Closes #1982
See merge request GNOME/gtk!1043
2019-08-05 12:20:06 +00:00
Luca Bacci
02935afe94
GtkFileChooserNativeWin32: Uninitialize COM at end of thread
...
GtkFileChooserNativeWin32 is created and shown on a secondary thread.
This thread initializes COM support with CoInitializeEx but does not
finalize it, so we have a leak. Fix that by calling CoUninitialize()
before thread terminates.
See Merge Request !1043
2019-08-04 18:03:37 +02:00
Luca Bacci
234d0443b2
GtkFileChoooserNative: change prepend to append for insertions in choices list
...
Although slightly less efficient, keeping the order in the choices
list makes it easier for GtkFileChooserNative implementations to
add widgets in the order specified by the application.
See Merge Request !1043
2019-08-04 18:03:21 +02:00
Luca Bacci
822deabdfe
Implement choices for GtkFileChooserNativeWin32
...
See Merge Request !1043
2019-08-04 18:03:05 +02:00
Timm Bäder
b2e94f81cf
window: Remove some leftover event code
2019-08-03 14:44:25 +02:00
Timm Bäder
109df77d87
popover: Use GTK_POS_BOTTOM as default position
...
This has always made a lot more sense.
2019-08-03 14:44:25 +02:00
Timm Bäder
76e3284ca1
colorchooserwidget: Inherit from GtkWidget
...
No reason for this to be a GtkBox.
2019-08-03 14:44:24 +02:00
Ray Strode
1612e38cda
window: sort icons before adding to _NET_WM_ICON
...
When processing the list of icons for a window to add them to
_NET_WM_ICON gdk_x11_surface_set_icon_list only adds as many
icon sizes as will fit within X protocol limits.
It achieves this by keeping a running total of the number of
bytes taken up by icons already processed and bails as soon
as it goes over the limit.
The problem is, one 512x512 icon is already over the limit,
and so no icons will get added at all if the first icon in
list is 512x512.
Indeed, the code seems to assume the list is sorted from smallest
icon to biggest icon.
This commit changes the caller to sort the list.
2019-08-01 16:48:58 -04:00
Matthias Clasen
4a631787bd
Merge branch 'subpixel-positioning' into 'master'
...
Subpixel positioning
See merge request GNOME/gtk!1024
2019-07-28 21:02:31 +00:00
Matthias Clasen
4de670b0b4
Turn off metrics hinting
...
This will be necessary to see the effects of subpixel positioning.
2019-07-28 16:42:52 -04:00
Christian Hergert
9926e6ebde
textlayout: introduce caching for GtkTextLineDisplay
...
This adds a GtkTextLineDisplayCache which can be used to cache a number
of GtkTextLineDisplay (and thus, PangoLayout) while displaying a view.
It uses a GSequence to track the position of the GtkTextLineDisplay
relative to each other, a MRU to cull the least recently used display,
and and a direct hashtable to lookup display by GtkTextLine.
We only cache lines that are to be displayed (!size_only). We may want to
either create a second collection of "size_only" lines to speed that up,
or determine that it is unnecessary (which is likely the case).
2019-07-28 10:34:15 -07:00
Christian Hergert
b930c5a8a2
textiter: add _gtk_text_iter_same_line()
...
This is a faster form to compare two text iter to see if they are on the
same line.
2019-07-28 10:34:15 -07:00
Matthias Clasen
7eb5dfd294
inspector: Show the pango backend
2019-07-28 11:39:16 -04:00
Matthias Clasen
988fac404a
Add pango version checks
...
Seems the ci does not have pango 1.44 yet.
2019-07-28 10:50:14 -04:00
Timm Bäder
eea76e8cce
textview: Remove some unnecessary gtk_widget_show() calls
...
Widgets are visible by default.
2019-07-28 08:44:45 +02:00
Timm Bäder
b2d639b6d9
window: Unroot with old display
...
Things might rely on the old display being set while unrooting.
Fixes #2052
2019-07-27 07:57:06 +02:00
Matthias Clasen
f1c7803f80
label: Parse new pango attributes
...
Support allow-breaks and show attributes.
These will be in pango 1.44
2019-07-27 00:02:08 -04:00
Emmanuele Bassi
f1e4efebb7
Merge branch 'gtk-4-add-TCRYPT-options-to-ask-password-dialog' into 'master'
...
gtkmountoperation: Add TCRYPT options to the ask-password dialog
See merge request GNOME/gtk!263
2019-07-25 10:16:11 +00:00
Matthias Clasen
e89e182565
Merge branch 'avoid-redundant-attributes' into 'master'
...
text layout: Avoid redundant text attributes
See merge request GNOME/gtk!1015
2019-07-24 23:47:41 +00:00
Matthias Clasen
552fe0406c
text layout: Avoid redundant text attributes
...
Don't insert text attributes if the font, or scale
or fallback did not actually change. This helps
Pango avoid excessive item breaks, which in turn
helps shaping to work across things like color
changes.
Related: https://gitlab.gnome.org/GNOME/pango/issues/28
2019-07-24 19:05:32 -04:00
Matthias Clasen
2f387c2a23
Merge branch 'missing-gobject-annotation' into 'master'
...
Add nullable annotation to combo_box_text_get_active_text
See merge request GNOME/gtk!1012
2019-07-24 13:50:04 +00:00
Timm Bäder
0d95c5dfe2
passwordentry: Normalize boolean value
2019-07-24 08:10:37 +02:00
Timm Bäder
f2a2908c59
passwordentry: Remove empty vfunc implementation
2019-07-24 08:10:26 +02:00
Timm Bäder
f4cb60dcca
textlayout: Avoid querying CSS state if we don't have to
...
This is actually pretty slow, and we almost never render a selection.
2019-07-24 07:54:30 +02:00
Timm Bäder
b3d0629709
popover: Remove some unnecessary checks
...
gtk_popover_move_resize() already checks whether the popover has a
surface.
2019-07-24 07:54:30 +02:00
Matthias Clasen
30f55c4d07
Remove a redundant vfunc
...
PangoRenderer has a perfectly adequate default
implementation of draw_glyphs, no need to duplicate that.
2019-07-23 23:28:24 -04:00
Ryan Westlund
f00d964f4f
Add nullable annotation to combo_box_text_get_active_text
2019-07-23 22:59:35 -04:00
Matthias Clasen
d2920c501d
Merge branch 'blink-later' into 'master'
...
Blink later
See merge request GNOME/gtk!1011
2019-07-24 02:05:32 +00:00
Matthias Clasen
af528b08dc
Merge branch 'error-nodes' into 'master'
...
Render error underlines as render nodes
See merge request GNOME/gtk!1009
2019-07-24 01:39:37 +00:00
Matthias Clasen
a628907891
textview: Defer cursor blinking on input
...
We were not calling the right cursor functions
in the commit handler.
2019-07-23 21:18:03 -04:00
Matthias Clasen
19ad4d67ef
textview: Delay initial cursor blinking
...
These changes follow the same changes for
gtktext.c in the previous commit.
2019-07-23 21:17:05 -04:00
Matthias Clasen
a4e427b44a
text: Delay initial cursor blinking
...
We used to have a solid cursor for 2/3 of the cycle,
now we start fading after 1/4th. To make up for it,
add half a cycle of delay.
2019-07-23 21:08:47 -04:00
Matthias Clasen
3278e9ab6c
Render error underlines as render nodes
...
Use a sequence of transformed squares,
instead of a cairo node. The drawing is not
identical to the previous code, but reasonably
close.
2019-07-23 18:31:39 -04:00
Christian Hergert
02d8e95b73
textlayout: remove use of gtk_text_layout_free_line_display
...
Now that these are reference counted, we no longer need to use
the variant requiring access to the GtkTextLayout.
2019-07-23 14:59:40 -07:00
Christian Hergert
e0b9b51e9f
textlayout: make GtkTextLineDisplay reference counted
...
This makes GtkTextLineDisplay use GRcBox instead of g_slice_*
directly. By using reference counting for this structure, we
can ensure that we hold an extra ref for one_display_cache as
well as caching additional GtkTextLineDisplay for the visible
range in the future.
2019-07-23 14:52:14 -07:00
Matthias Clasen
fb06b7fa94
text: Remove an outdated comment
2019-07-23 15:14:38 -04:00
Matthias Clasen
7b451678f5
fix the build
2019-07-23 14:26:32 -04:00