Commit Graph

14125 Commits

Author SHA1 Message Date
Benjamin Otte
67fe600b2e widgetpath: Factor out the element copy function
I'll need that function soon.
2011-06-02 02:03:51 +02:00
Benjamin Otte
f0e5b57699 widgetpath: Use ref/unref in boxed function
This way we avoid lots of copying when using widget paths as properties.

Keeping this as a separate patch so bugs where people were modifying a
structure they shouldn't are easily visible.
2011-06-02 02:03:51 +02:00
Benjamin Otte
03eb4c38c9 widgetpath: Make structure refcounted
I want to use widget paths in a way that make a lot more sense with a
refcounted structure. See the following patches.
2011-06-02 02:03:51 +02:00
Benjamin Otte
91602cca6e themingengine: Add support for the border-radii 2011-06-02 02:03:51 +02:00
Benjamin Otte
90ff426396 css: Add all border-radius properties
Implement all border-radisu properties as specified by
http://www.w3.org/TR/css3-background/#the-border-radius
The end goal here is to get joined buttons to really look joined.
2011-06-02 02:03:51 +02:00
Benjamin Otte
812b32e9e5 styleproperty: Add a helper function for printing doubles
We will want to print doubles more often, so add a little helper
function for it. We cannot use printf() here, because we want English
locale output.
2011-06-02 02:03:51 +02:00
Benjamin Otte
97a07a79f3 styleproperty: Make keybindings use custom parse/print functions
We don't want to use it for GPtrArray.
2011-06-02 02:03:50 +02:00
Benjamin Otte
d14fbf3254 styleproperty: Allow passing in a parse func and a print func
It's not used yet, but it's now possible to specify a custom read or
write func.
2011-06-02 02:03:50 +02:00
Benjamin Otte
715674c45b styleproperty: Rename ParseFunc and PrintFunc typedefs
Rename them to GtkStyleParseFunc and GtkStylePrintFunc, so we can export
them.
2011-06-02 02:03:50 +02:00
Benjamin Otte
d0e1e2b103 css: Move property parsing into styleproperty file
Just shuffles code around for parsing properties.
2011-06-02 02:03:50 +02:00
Benjamin Otte
5a42464547 css: Rename function to _gtk_style_property_parse_value()
... and take an optional style property as argument. This way, we can
allow custom parse functions for properties. The style property needs to
be optional so that we can use it for widget style properties, too.
2011-06-02 02:03:50 +02:00
Benjamin Otte
35488f5846 css: Rename struct variable
I want to add parse_func as something different soon.
2011-06-02 02:03:50 +02:00
Benjamin Otte
3e7f74c456 styleproperty: Change _css_value_to_string()
Name it _gtk_style_property_print_value() and actually pass it the style
property. This way, we can later change it to use custom print functions
for different style properties.
2011-06-02 02:03:50 +02:00
Benjamin Otte
02a9cb5bc0 css: Change to_string() to print()
It's preferrable to print to an existing GString instead of returning a
char* everywhere that needs to be freed later.
2011-06-02 02:03:50 +02:00
Benjamin Otte
a6daba5e78 API: Change semantics of gtk_container_get_child_path()
Include the child widget path in the returned path now. This allows
customizing the path of the current widgets - like adding flags to child
widgets (and maybe siblings in the future).
2011-06-02 02:03:50 +02:00
Benjamin Otte
b0616c8225 API: Add gtk_widget_path_append_for_widget()
Includes a bunch of header shuffling so we can use GtkWidget* in
gtkwidgetpath.h
2011-06-02 02:03:50 +02:00
Benjamin Otte
352569298a notebook: Implement height_for_width and width_for_height getters 2011-06-02 00:07:25 +02:00
Benjamin Otte
4d78e9c8af notebook: Rewrite size request function for wfh 2011-06-02 00:07:25 +02:00
Benjamin Otte
d7519e6ca2 notebook: Split out tabs size computation into its own function 2011-06-02 00:07:25 +02:00
Benjamin Otte
edd2f24b6e notebook: Compute tab width in a simpler way
This code should be more obvious: The check only needs to check for
scrollable widgets, and only needs to compare to tab_width.

As a side note, for vis_pages == 1, tab_width will be smaller than
tab_max + stuff, so this code will not behave differently.
2011-06-01 21:57:45 +02:00
Benjamin Otte
86aefc2c31 notebook: Remove uneeded function declaration 2011-06-01 21:45:21 +02:00
Benjamin Otte
975f735fb7 notebook: Include arrow size in tab size computation
We don't want tabs to resize when a 2nd page is added, just because the
scroll arrows are now visible. And we do want the arrow size to be
included.

Note: Previosuly this code was never run, as the check
  requisition->width < tab_width
was only run when tab_width wasn't computed, so was still equal to 0
(same for the height). So what this patch essentially does it add the
functionality of the if switch.
2011-06-01 17:46:22 +02:00
Matthias Clasen
1371a86fb1 GtkLabel: Make selection behave more similar to GtkEntry
For shift-clicks inside the selection, shrink the selection.
https://bugzilla.gnome.org/show_bug.cgi?id=353712
2011-06-01 01:08:13 -04:00
Matthias Clasen
4cd9009c57 Trivial NULL vs 0 confusion 2011-06-01 00:05:06 -04:00
Matthias Clasen
c56150ea5b Fix an example 2011-05-31 23:50:13 -04:00
Matthias Clasen
2833cc2327 Change GtkTreePath to grow exponentially
To avoid quadratic behaviour when building up
paths by repeated appending indices. Bug 634491.
2011-05-31 22:10:58 -04:00
Matthias Clasen
906292541a Add tests for GtkTreePath 2011-05-31 22:10:40 -04:00
Matthias Clasen
1c261fe2ae GtkSearchEngineTracker: avoid an unused variable warning 2011-05-31 21:26:40 -04:00
Matthias Clasen
949125b56b Make tracker search engine less verbose
Patch by Vincent Untz,
https://bugzilla.gnome.org/show_bug.cgi?id=642768
2011-05-31 20:50:42 -04:00
Matthias Clasen
0b9cd78017 Add annotations to gtk_css_provider_load_from_data
https://bugzilla.gnome.org/show_bug.cgi?id=646859
2011-05-31 20:37:43 -04:00
Matthias Clasen
5abadc6d95 GtkIconTheme: a small optimization
John Lindgren points out in bug 650202 that using judicious
use of g_key_file_has_key() can save some cycles in application
startup.
2011-05-31 20:29:53 -04:00
Matthias Clasen
0705474be6 GtkEntry: don't forget to disconnect idles
As pointed out by John Lindgren in bug 650114, GtkEntry forgets
to disconnect an idle source when the completion is set to NULL.
2011-05-31 20:11:28 -04:00
Alexander Saprykin
8d9f413c9b gtkeditable.c: Remove unused variable in example code
https://bugzilla.gnome.org/show_bug.cgi?id=650167
2011-05-31 20:09:58 -04:00
Matthias Clasen
7ef362ec67 GtkEntryCompletion: add a sanity check
Patch by John Lindgren,
https://bugzilla.gnome.org/show_bug.cgi?id=650110
2011-05-31 20:07:14 -04:00
Diego Celix
7839c27e13 gtk/gtkcolorsel: gtk_misc_set_alignment replacing
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkcolorsel.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-05-31 20:02:43 -04:00
Diego Celix
95fd3d708d gtk/gtknotebook: gtk_misc_set_alignment replacing
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtknotebook.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-05-31 20:02:42 -04:00
Diego Celix
d291709ee7 gtkcustompaperunixdialog: gtk_misc_set_alignment
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkcustompaperunixdialog.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-05-31 20:02:41 -04:00
Diego Celix
ee18c5fef3 gtk/gtkfilechooserbutton: gtk_misc_set_alignment
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkfilechooserbutton.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-05-31 20:02:39 -04:00
Matthias Clasen
ab6e3366bc GtkAppChooser: improve docs
Add a cross-reference to GContentType.
https://bugzilla.gnome.org/show_bug.cgi?id=650012
2011-05-31 20:00:50 -04:00
Matthias Clasen
8143ce69eb GtkApplication: Add window-added/-removed signals
This is useful to let unrelated parts of an application (or
plugins) learn about the windows of an application. Based
on a patch by Matt Barnes,
https://bugzilla.gnome.org/show_bug.cgi?id=641087
2011-05-31 19:12:13 -04:00
Matthias Clasen
75390b2d60 Sort GtkApplication windows by most-recently-focused
Based on a patch by Matt Barnes,
https://bugzilla.gnome.org/show_bug.cgi?id=624539
2011-05-31 18:28:55 -04:00
Javier Jardón
fb9e4c2c37 all: avoid boxed structs copying where possible (and 2)
Use the GtkStyleContext accessors for boxed properties where possible,
to reduce allocations.
2011-05-31 19:18:11 +02:00
Javier Jardón
e5c7daa828 tests: avoid boxed structs copying where possible
Use the GtkStyleContext accessors for boxed properties where possible,
to reduce allocations.
2011-05-31 19:12:24 +02:00
Carlos Garnacho
20433efbfa gtkcssprovider: Free shorthand border GValues in the right place
The call to gtk_border_free() within unpack_border() felt completely
in the wrong place, as the border actually pertains to the GValue
being unpacked. Plus, the GValue itself was also being leaked.
2011-05-30 19:29:22 +02:00
Carlos Garnacho
2c8e01dc80 gtkcssprovider: plug several leaks
In finalize(), clear all rulesets.
In parse_declaration(), Free the GValue under unhandled error situations.
In gtk_css_provider_load_internal(), Do not leak the file contents.
2011-05-30 19:26:28 +02:00
Carlos Garnacho
de4ca3ae13 gtkstyleproperty: Plug two leaks
In rgba_value_parse(), unref the symbolic color once we've resolved it.
In gradient_value_parse(), take the GtkGradient so we leave no dangling
references.
2011-05-30 19:21:42 +02:00
Carlos Garnacho
b68172b2c6 gtkstyleproperties: zero GValue out before using G_VALUE_COLLECT_INIT()
Fixes invalid reads in valgrind
2011-05-30 19:18:41 +02:00
Carlos Garnacho
747dc65c2c gtkcssprovider: Use g_slice_dup() to copy GValues around
GValues stored in GtkCssRulesets are gslice managed, so don't
g_memdup() GValues from shorthand properties. This fixes
memory corruptions when reloading contents in a GtkCssProvider.
2011-05-30 19:13:36 +02:00
Benjamin Otte
3500063bc1 liststore: Replace macro with an inline function
Also remove a duplicate check in gtk_list_store_iter_is_valid().

gcc was complaining about "comparison always true" when using the macro.
2011-05-27 16:11:10 +02:00
Benjamin Otte
0b653abcd4 styleproperties: Remove unused priv variables 2011-05-27 16:11:10 +02:00