Commit Graph

18588 Commits

Author SHA1 Message Date
Matthias Clasen
65f0e194e0 Fix a small memory leak 2013-06-15 23:35:25 -04:00
Matthias Clasen
5707e81c81 GtkBuilder: don't leak callbacks
This was noticed while running the testsuite under valgrind.
2013-06-15 23:33:51 -04:00
Matthias Clasen
c9ec4ba5a1 GtkImage: Fix the initial value of icon-size
Since we are pulling the icon-size out of the icon helper now,
we should set its icon-size when constructing it.
2013-06-15 20:23:01 -04:00
Matthias Clasen
87190233ef GtkListBox: cosmetics
Clean up formatting trivia, adjust includes to gtk conventions,
use P_() for properties, etc.
2013-06-15 12:32:59 -04:00
Bastien Nocera
3d11b9b758 GtkSearchBar: Mention we don't handle Ctrl+F for the app
There's probably an expectation from the app developers that
Ctrl+F or similar common shortcuts for starting a search will
be handled by the widget, when this is not the case. Explicitely
mention it in the docs to avoid confusion.

https://bugzilla.gnome.org/show_bug.cgi?id=701523
2013-06-14 19:10:39 +02:00
Bastien Nocera
19c5b37d9d GtkHeaderBar: Fix buildable function names
It's a GtkHeaderBar, not GtkHeader.

https://bugzilla.gnome.org/show_bug.cgi?id=701346
2013-06-14 19:10:39 +02:00
Bastien Nocera
8a45cb5762 GtkHeaderBar: Make labels creation available privately
So it can be reused in subclasses

https://bugzilla.gnome.org/show_bug.cgi?id=701345
2013-06-14 19:10:39 +02:00
Alexander Larsson
264cbc9e35 GtkStack: Switch order on left/right up/down transitions.
When the new child is on the left, scroll right. This makes the
thing look physically "real".
2013-06-13 20:55:05 +02:00
Alexander Larsson
418ac673a3 GtkStack: Fix drawing of sliding
We were not drawing the view window, so the old widget
was clipped for the sliding transitions.
2013-06-13 20:50:41 +02:00
Erick Pérez Castellanos
33a1c4d6e0 GtkStack: Add position-dependent slide transitions
These go left/right or up/down depending on the relative
order of the children being switched between.
2013-06-13 20:33:42 +02:00
Benjamin Otte
0d55d9b96b treeview: Use gtk_adjustment_configure()
... instead of manually setting all the values. Makes for nicer code and
less signal emissions.
2013-06-13 15:31:35 +02:00
Alexander Larsson
61f44628d6 GtkListBox: Consider width of filtered rows
Without this lists keep shrinking in width as they are filtered, whic
looks really bad.
2013-06-13 12:17:08 +02:00
Alexander Larsson
220eb45ef0 GtkListBox: Protect against reentrancy.
Activating a row may destroy the widget, so keep a ref since
we're doing thing to the listbox after emission.
2013-06-13 12:17:08 +02:00
Alexander Larsson
0f93b7f6c4 GtkListBox: minor fix
Move the check inside the existing chech which also checks
for active_row != NULL for extra safety.
2013-06-13 12:17:08 +02:00
Alexander Larsson
1dd0b468a7 GtkListBox: Add style classes for lists and rows 2013-06-13 12:17:07 +02:00
Alexander Larsson
3bb2d15195 GtkListBox: Add getter for activate_on_single_click 2013-06-13 12:17:07 +02:00
Alexander Larsson
90ff262df6 GtkListBox: Rename reXXX to invalidate_XXX
This is lets us later move to a setup where the rows are not
immediately resorted but queued until next layout.
2013-06-13 12:17:07 +02:00
Alexander Larsson
caacce6d44 GtkListBox: Add placeholder widget support 2013-06-13 12:17:07 +02:00
Alexander Larsson
b0b746b2ea GtkListBox: Track the number of visible children 2013-06-13 12:17:07 +02:00
Alexander Larsson
9510b79d78 GtkListBox: Track visible in the row
This is a minor performance improvement, but its mainly to
allow us to track when n_visible_children changes.
2013-06-13 12:17:07 +02:00
Alexander Larsson
217c2bb087 GtkListBox: Open code the update_header calls in add()
Rather than reusing row_visibility_changed. This means
row_visibility_changed really means that the row visibility changed.
2013-06-13 12:17:07 +02:00
Alexander Larsson
1eb729dcd9 GtkListBox: Make reseparate a no-op for hidden lists
We already take care to not track headers when the listbox is hidden,
because that can be very expensive during creation, so we might as
well skip reseparate() too. The only time we don't want to skip it
is when we're about to show the list.
2013-06-13 12:17:07 +02:00
Alexander Larsson
cbf294b27e GtkListBox: Remove some unnecessary code
the unhighlight call already NULLs out drag_highlighted_row
2013-06-13 12:17:07 +02:00
Alexander Larsson
2ba67a0b8b GtkListBox: Fix docs
Removed some cut/paste leftovers
2013-06-13 12:17:07 +02:00
Alexander Larsson
b119b022a7 GtkListBox: Allow unselecting of rows in SINGLE mode 2013-06-13 12:17:07 +02:00
Alexander Larsson
cc4ac1ee70 GtkListBox: Rename separators to headers 2013-06-13 12:17:07 +02:00
Alexander Larsson
4a0b6e5479 GtkListBox: Remove refilter signal
This was added from https://bugzilla.gnome.org/show_bug.cgi?id=691979
where it was wanted in order to get a "all children filtered" kind
of row. However, the solution is not really generic enough, because
filtering can happen for other reasons than a full refilter (i.e. due
to a row change), and the partial fix you can get by counting children
after refilter can be achieved by manually doing it whenever you manually
called refilter anyway.

Its possible we should have some better solution for the "empty state"
though.
2013-06-13 12:17:07 +02:00
Alexander Larsson
c6ac711508 GtkListBox: Add docs 2013-06-13 12:17:07 +02:00
Alexander Larsson
6a77754c77 GtkWidget: Change which states propagate
Historically the following states propagated to children:
  GTK_STATE_FLAG_ACTIVE
  GTK_STATE_FLAG_PRELIGHT
  GTK_STATE_FLAG_SELECTED
  GTK_STATE_FLAG_INSENSITIVE
  GTK_STATE_FLAG_INCONSISTENT
  GTK_STATE_FLAG_BACKDROP

However, several of these are problematic on containers like GtkListBox.
For instance, if a row is ACTIVE or SELECTED then all children (like e.g
a button) inside the row will *also* look active/selected. This is almost
never right. The right way to theme this is to catch e.g. SELECTED on the
container itself and set e.g. the color and let the children inherit
the color instead of the flag.

We now propagate only these flags:
  GTK_STATE_FLAG_INSENSITIVE
  GTK_STATE_FLAG_BACKDROP

Which make sense to be recursive as they really affect every widget
inside the container.

However, this is a CSS theme break, and while most things continue working
as-is some themes may need minor tweaks.
2013-06-13 12:17:07 +02:00
Alexander Larsson
ecff28bb68 GtkListBox: Remove add_to_scrolled()
Now that we automatically set up the focus_vadjustment we only
need the adjustment to handle the page-up/down scroll length correctly.

We use parent_set to automatically pick up the adjustment from a
scrollable (i.e. viewport) parent which makes add_to_scrolled useless, so
it can be removed.
2013-06-13 12:17:07 +02:00
Alexander Larsson
17c559c429 GtkScrollableWindow: Automatically set focus adjustments
When adding with a viewport we automatically set the focus
adjustments on the viewport from the scrolled window, so that
when any child widget gets focused we automatically scroll to it.

This is generally nice, but its particularly important for GtkListBox
where focus changing is how we navigate between rows.

We also ensure that the adjustments are always set before adding the
child to the viewport, which we will need later to pick up the
adjustments on add.
2013-06-13 12:17:06 +02:00
Alexander Larsson
157102aa73 GtkListBox: No need to manually clamp adjustment to focus
Now that we use real widgets for rows the focus_vadjustment is
enough.
2013-06-13 12:17:06 +02:00
Alexander Larsson
932535d444 GtkListBox: Clean up DnD code
Unhighlight rows if they are removed.

Drop the automatic drag motion based auto-scrolling. This is not really
right, as it e.g. hardcodes auto-scroll regions and assumes we're the only
widget inside the scrolled container. Its also imho in the wrong place,
autoscrolling if any should be done on the scrolled-window or viewport.
All the removed code is implementable outside Gtk+ though.
2013-06-13 12:17:06 +02:00
Alexander Larsson
e319867f80 Add GtkListBox
This is basically an import/rename of EggListBox from the row-widget
branch of egg-list-box.
2013-06-13 12:17:06 +02:00
Christian Persch
781b85088f im: Deprecate gtk_im_multicontext_append_menuitems
Bug #701840.
2013-06-09 09:51:55 -04:00
Kalev Lember
a37450110b Fix string allocation handling with GtkBuilder translations
Use g_string_assign to avoid issues with assigning GString's internal
buffer back to the same string. This can happen when no translations are
available and _gtk_builder_parser_translate returns back the same
pointer that was passed in.

This fixes a regression from commit e9f182e37a
that caused GtkComboBoxText <items> from GtkBuilder to show up empty if
no translations are available.

https://bugzilla.gnome.org/show_bug.cgi?id=700629
2013-06-08 10:54:25 +02:00
Matthias Clasen
8b811b623c Remove the show-unicode-menu and show-input-method-menu settings
These are no longer used.
2013-06-07 18:13:47 -04:00
Matthias Clasen
27a15d9a7d GtkTextView: Remove the Unicode and input method menus
Submenus in the context menu are not great, and these two
in particular are not something we want to have there.
2013-06-07 18:13:20 -04:00
Matthias Clasen
4a62d19da7 GtkEntry: Remove the Unicode and input method menus
Submenus in the context menu are not great, and these two
in particular are not something we want to have there.
2013-06-07 18:10:15 -04:00
Bastien Nocera
dbbea8b97e Add GtkSearchBar widget
This widget is a toolbar that will popup automatically when
searches should be started, and dismissed when they are finished.

https://bugzilla.gnome.org/show_bug.cgi?id=700787
2013-05-31 17:09:11 +02:00
Benjamin Otte
63eb47577e API: Deprecate gtk_container_resize_children()
It does ad things and is undocumented, so I'll just silently deprecate
it.
2013-05-30 20:02:30 +02:00
Benjamin Otte
299714dd1a container: Don't use to-be-deprecated API
Instead, do what that API does manually.
2013-05-30 20:02:05 +02:00
Benjamin Otte
4e50596b37 window: Call size_allocate() to allocate a size
Don't call gtk_container_resize_children().

https://bugzilla.gnome.org/show_bug.cgi?id=700185
2013-05-30 19:28:54 +02:00
Timothy Arceri
44cd166447 GtkBookmarksManager: Refactor duplicate set error code and localise error strings
https://bugzilla.gnome.org/show_bug.cgi?id=593079
2013-05-30 10:37:58 -05:00
Xavier Claessens
92823b2201 GtkMenuItem: Take padding into account to position submenu arrow
Since commit a69619edbc, it not
possible anymore for the style to add space between the border
and the arrow.

https://bugzilla.gnome.org/show_bug.cgi?id=700779
2013-05-29 14:53:17 +02:00
Benjamin Otte
0bd76a855c cssimage: Add forgotten line
That line was already missing in the initial commit it seems.
2013-05-28 15:24:04 +02:00
Benjamin Otte
f6c746a99d cssanimation: Use property id here 2013-05-28 15:24:04 +02:00
Benjamin Otte
6bf059e36f treeview: Don't cache the height
Instead, use the correct value all the time.
2013-05-28 15:24:03 +02:00
Chun-wei Fan
da31982379 Fix build on C89 compilers
-Avoid defining variables in the middle of the block
-Include fallback-c89.c in gtkrevealer.c in place of math.h as
 fallback-c89.c includes math.h itself, and is needed for round()
2013-05-28 13:36:54 +08:00
Matthias Clasen
fe2260c53d Fix distclean
extract-strings was left behind.
2013-05-27 18:25:31 -04:00