Commit Graph

30683 Commits

Author SHA1 Message Date
Timm Bäder
df79f02310 paned: Don't unnecessarily redraw handle in size_allocate
We size_allocate it after all, which will redraw it.
2018-06-18 17:35:02 +02:00
Timm Bäder
bd99ca2f04 paned: Store GParamSpecs
So we can use the more efficient g_object_notify_by_pspec everywhere.
2018-06-18 17:35:02 +02:00
Timm Bäder
889fcf64b6 Remove gtk_css_node_reverse_children
Not needed anymore.
2018-06-18 17:35:02 +02:00
Timm Bäder
3fadb536d9 toolbar: Stop reordering css nodes based on text direction 2018-06-18 17:35:02 +02:00
Timm Bäder
fb0d8eacc3 headerbar: Stop reordering css nodes depending on text direction 2018-06-18 17:35:02 +02:00
Timm Bäder
fffb3161bc notebook: Stop reversing tabs based on text direction 2018-06-18 17:35:02 +02:00
Timm Bäder
3be2cb8f63 builder: Fix g-i annotations of _get_translation_domain
The return value can be null and is (transfer none).
2018-06-18 17:35:02 +02:00
Timm Bäder
8267605ba2 builder: Use TRUE/FALSE for error return values
Instead of guint and 0/1.
2018-06-18 17:35:02 +02:00
Timm Bäder
da4d8b7d94 builder: Remove priv pointer 2018-06-18 17:35:02 +02:00
Timm Bäder
01d4538223 box: Don't reorder children based on text direction
Make :first-child always be the first child, i.e. the leftest one in LTR
and the rightest one in RTL.
2018-06-18 17:35:02 +02:00
Timm Bäder
da27627696 paned: Don't reorder css nodes based on text direction 2018-06-18 17:35:02 +02:00
Timm Bäder
85e49a1051 center box: Don't reorder css nodes in RTL
So widget order matches css order. We will do the same thing with GtkBox
eventually.
2018-06-18 17:35:02 +02:00
Timm Bäder
798944cb26 scrolledwindow: Remove priv pointer 2018-06-18 17:35:02 +02:00
Timm Bäder
0b12fd9c1b center box: Remove snapshot implementation 2018-06-16 10:09:12 +02:00
Timm Bäder
d3ffaa0236 button: Remove measure implementation
This is already done by GtkBin.
2018-06-16 10:09:12 +02:00
Timm Bäder
1b208eb457 combobox: Remove priv pointer 2018-06-16 10:09:12 +02:00
Jakub Steiner
c5fa657631 aboutbox: use a more fitting 'design by" role
- in most cases, authors listed under "artwork by" are actually responsible for
  the design of the app as a whole

Fixes issue #1153
2018-06-14 16:36:38 +02:00
Mohammed Sadiq
bdf3b6f64d Revert "imcontext: Make size arguments be gsize and not int"
This was committed accidently.

This reverts commit eefd2d6f10.
2018-06-14 11:15:14 +05:30
Benjamin Otte
eefd2d6f10 imcontext: Make size arguments be gsize and not int
Otherwise gcc complains when we use these as arguments to g_new() on
32bit architectures with:

../gtk/gtkcomposetable.c: In function ‘gtk_compose_table_list_add_array’:
/usr/include/glib-2.0/glib/gmem.h:217:10: warning: argument 1 range [2147483648, 4294967295] exceeds maximum object size 2147483647 [-Walloc-size-larger-than=]
      __p = g_##func##_n (__n, __s);   \
      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmem.h:279:42: note: in expansion of macro ‘_G_NEW’
 #define g_new0(struct_type, n_structs)   _G_NEW (struct_type, n_structs, malloc0)
                                          ^~~~~~
../gtk/gtkcomposetable.c:851:22: note: in expansion of macro ‘g_new0’
   gtk_compose_seqs = g_new0 (guint16, length);
                      ^~~~~~
/usr/include/glib-2.0/glib/gmem.h:96:10: note: in a call to allocation function ‘g_malloc0_n’ declared here
 gpointer g_malloc0_n      (gsize  n_blocks,
          ^~~~~~~~~~~
2018-06-14 06:37:00 +05:30
Mohammed Sadiq
d4693b2dc8 snapshot: Trivial typo fix in comment 2018-06-13 19:58:01 +05:30
Rico Tzschichholz
b1f934d3b0 picture: Fix g-i annotation warning 2018-06-13 13:08:28 +02:00
Mohammed Sadiq
0c57e3131f overlay: Use the right property variable name 2018-06-11 17:43:16 +05:30
Mohammed Sadiq
0d46081645 overlay: Add support for clipping overlay widgets
Sometimes users may want to restrict the growth of child
widgets in a GtkOverlay to grow atmost the size of the overlay.

Let's add a support for that.
2018-06-11 16:24:29 +05:30
Matthias Clasen
4f632296a5 Merge branch 'lrn/gtk4warnings' into 'master'
Fix a lot of warnings in GTK4

See merge request GNOME/gtk!188
2018-06-10 23:14:42 +00:00
Matthias Clasen
c047e97cfa Merge branch 'master' into 'master'
gtk: Add gtk_is_initialized() and gtk_get_main_thread()

See merge request GNOME/gtk!186
2018-06-10 23:05:50 +00:00
Matthias Clasen
bc13a58f3c Merge branch 'lrn/aligned-alloc' into 'master'
Aligned allocators for GTK4

Closes #856

See merge request GNOME/gtk!187
2018-06-10 22:05:12 +00:00
Руслан Ижбулатов
43f37894b0 Use correct stat struct for ftw()
check_dir_mtime() is called by ftw() and is given
the real stat struct, not its glib version (which may
or may not be the same as "struct stat").

This is irrelevant for MSVC (it has no ftw()) and
works correctly for MinGW-w64 (which declares stat
structures correctly). If mingw.org complains, add
a special ifdef for it later.
2018-06-10 21:21:27 +00:00
Руслан Ижбулатов
0365dadad9 See if _MSC_VER is defined before checking its value 2018-06-10 21:21:25 +00:00
Руслан Ижбулатов
9330be8cf9 Fix missing default switch case in DllMain 2018-06-10 21:21:24 +00:00
Руслан Ижбулатов
43d6fe2583 Fix missing default switch cases in gtkimcontextsimple 2018-06-10 21:21:22 +00:00
Руслан Ижбулатов
411c535956 Fix some warnings in W32 part of gtkmain
* Add missing default cases
* Cast string literals as non-const
2018-06-10 21:21:20 +00:00
Руслан Ижбулатов
58fc1229c1 Remove unused variables (mostly in W32 code) 2018-06-10 21:21:01 +00:00
Руслан Ижбулатов
c02bc22cc5 Use aligned allocators for GtkSnapshot
Any data that is later fed to graphene must be
allocated with proper alignment, if graphene
uses SSE2 or GCC vector instructions.

This adds custom array code (a streamlined copy
of GArray with all unnecessary bells and whistles removed),
which is then used for the state_stack instead of GArray.

There's also a runtime check for the size of GtkSnapshotState
itself being a multiple of 16. If that is not so, any array
elements past the 0th element will lose alignment.
There are probably struct attributes that can
make GtkSnapshotState always have size that is a multiple
of 16, but we'll burn that bridge if we cross it.
2018-06-10 20:35:54 +00:00
Benjamin Otte
a34a5df674 picture: Don't use g_str_equal() with potential NULLs 2018-06-10 02:56:18 +02:00
Benjamin Otte
4c961349ab dnd: Ref the GdkDrop during the DND operation
It might go away if the DND takes too long otherwise...
2018-06-10 02:35:30 +02:00
Benjamin Otte
b7ecfbce21 quartz: Remove gtkdnd-quartz.c
It shows up in my git diff calls and is completely broken.
2018-06-10 02:33:53 +02:00
Benjamin Otte
884aaa2193 iconhelper: Always size contents to icon size
No more special casing for paintables. If you want the special case for
paintables, you should use GtkPicture.
2018-06-10 02:25:28 +02:00
Benjamin Otte
f58c556adb image: Remove gtk_image_set_keep_aspect_ratio()
and gtk_image_set_can_shrink().

Images are meant to always be icon-sized, they can never shrink below
that.

And images are icons, so they are meant to be square. If they are
not, we pretned that's by accident and keep aspect ratio.
2018-06-10 02:25:28 +02:00
Benjamin Otte
45d78f360f video: Use a Picture instead of an Image 2018-06-10 02:23:02 +02:00
Benjamin Otte
6546ef3459 picture: Introduce
This commit introduces GtkPicture, which is supposed to complement
GtkImage.

GtkImage will be adapted to always display an icon, while
GtkPicture displays regular imagery.
2018-06-10 02:23:02 +02:00
Timm Bäder
cfbba2c710 widget: Use priv pointer less
Instead declare a priv local. We should do this even if we don't remove
the priv pointer from GtkWidget entirely, just to stay consistent with
new code we introduce.
2018-06-09 21:25:15 +02:00
Philippe Normand
2f181df1cf gtkmain: Add gtk_get_main_thread()
This utility function can be useful to know which thread was initialized for
GTK+.
2018-06-08 18:41:54 +01:00
Philippe Normand
542ad4fdc5 gtkmain: Add gtk_is_initialized()
This utility function can be useful to check whether GTK+ was already
initialized or not.
2018-06-08 18:39:38 +01:00
Matthias Clasen
46d8c84049 Merge branch 'master' into 'master'
Fix reference to user styles in gtkstyleprovider.h

See merge request GNOME/gtk!184
2018-06-07 18:27:25 +00:00
Mohammed Sadiq
59c8fdff29 font-button: Suggest non deprecated function in docs
gtk_font_button_get_font_name() has been deprecated in 3.22 and
its public API is removed from GTK4.
2018-06-07 15:45:32 +05:30
Matijs van Zuijlen
932e5ea34e Fix reference to user styles in gtkstyleprovider.h 2018-06-07 08:54:23 +00:00
Daniel Boles
3396c5e983 SizeRequest: Round px values up for min CSS sizes
Otherwise, requesting a min size in em where the equivalent in px had a
fractional part would lead to the widget getting allocated 1 too few px.
You could see this in the CSS property vs. allocation in the Inspector.

Note that margin/border/padding are left alone: the rationale is that we
do as browsers do, and Benjamin said we already do that for those,
whereas his tests on min-(width|height) showed otherwise. My subsequent
analysis indicated it to be far less clear-cut than that, but he remains
unconvinced that we should ceil() all the things! So just do these ones.

https://gitlab.gnome.org/GNOME/gtk/issues/1088
2018-06-05 18:49:52 +01:00
Timm Bäder
5c24bbf00c popover: Add missing close paren in docs 2018-06-04 21:58:44 +02:00
Timm Bäder
a1e3e9dd17 colorbutton: Remove priv pointer 2018-06-04 21:58:44 +02:00
Timm Bäder
d53c28b07a aspectframe: Remove unused member 2018-06-04 21:58:44 +02:00