Commit Graph

467 Commits

Author SHA1 Message Date
Bastien Nocera
90a4f8dc4b notebook: Don't set notebook style with hidden tabs
When tabs are not shown, and the notebook is used as a container,
we should not set the notebook style, otherwise the theme has no
way to know whether tabs are shown or not, and which colour to draw
the background.

https://bugzilla.gnome.org/show_bug.cgi?id=640692
2011-03-17 18:30:40 +00:00
Cosimo Cecchi
c9f38ba518 notebook: make GtkNotebook respect the focus-padding style property
https://bugzilla.gnome.org/show_bug.cgi?id=644348
2011-03-14 11:59:27 -04:00
Cosimo Cecchi
5215f72bd7 notebook: add an 'initial-gap' style property
It adds a gap before the first tab in the notebook.

https://bugzilla.gnome.org/show_bug.cgi?id=643841
2011-03-09 14:15:43 -05:00
Cosimo Cecchi
a3b3c91001 notebook: flip the render order
The render order for tabs is now

- left to right until the active tab
- right to left until the active tab
- active tab

This allows themes that use non-straight lines for the tab curvature to
draw them not worrying about flipping one side after the active tab.
2011-03-07 00:49:14 -05:00
Cosimo Cecchi
a54ca77fb7 notebook: fixup the last commit
Let the tab overlap eat the padding, otherwise having tab-overlap >
tab-curvature without cutting the label is impossible.
This way we give the label widget all the allocation possible before
giving up and cutting it if the values for tab-overlap are too extreme
for the given padding.
2011-03-06 22:08:26 -05:00
Cosimo Cecchi
da814ae767 notebook: make sure the label widget allocation not exceeds the overlap 2011-03-06 18:45:20 -05:00
Cosimo Cecchi
27a0cef60c notebook: make sure the allocation keeps track of the tab curvature
This was a genuine typo, because "padding" was calculated but unused in
this branch of the code.
2011-03-06 14:48:09 -05:00
Matthias Clasen
2ccc6c0d60 GtkNotebooks: fix regressions from tab-pack removal 2011-03-03 18:30:03 -05:00
Matthias Clasen
a71e801943 GtkNotebook: Don't let tab allocation go negative 2011-03-03 18:30:03 -05:00
Matthias Clasen
d9fcc4c630 Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 21:51:38 -05:00
Carlos Garnacho
13a3954ad4 GtkNotebook: only set/unset active flag on the tab label 2011-01-23 19:35:21 +01:00
Pavel Holejsovsky
2f0d40335b [GI] Add missing (transfer) annotations 2011-01-20 13:57:18 +01:00
Tristan Van Berkom
ac61edb9fc Avoid calling gtk_widget_is_visible(NULL) in _gtk_notebook_get_tab_flags().
The tab can be NULL here when GtkNotebook:show-tabs is FALSE.
2011-01-15 21:34:49 +09:00
Matthias Clasen
98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05:00
Matthias Clasen
b5c6904c2f Drop explicit includes of gdkkeysyms.h
These are no longer needed. At the same time, port gtkimcontextsimpleseqs.h
to use the new GDK_KEY_ symbols.
2011-01-04 12:21:41 -05:00
Matthias Clasen
7352a166b6 Formatting fixes and whitespace cleanups 2011-01-04 02:21:38 -05:00
Matthias Clasen
32bfc980c1 Remove pack property altogether 2011-01-04 02:06:03 -05:00
Matthias Clasen
723fedef8b Remove pack consideration from tab drawing 2011-01-04 02:03:03 -05:00
Matthias Clasen
4ea886aea1 Don't consider pack when allocating tabs 2011-01-04 01:57:22 -05:00
Matthias Clasen
f9d6bc6cca Drop pack consideration from gtk_notebook_search_page 2011-01-04 01:39:18 -05:00
Matthias Clasen
a7bb193377 Drop internal function to find page position 2011-01-04 01:36:09 -05:00
Matthias Clasen
f838ecf9f0 Remove pack consideration from tab dnd 2011-01-04 01:35:52 -05:00
Matthias Clasen
88501d527d Remove pack consideration from tab reordering 2011-01-04 01:23:05 -05:00
Matthias Clasen
03b37a2e54 Remove pack arguments from some internal functions
This removes pack from gtk_notebook_{set,query}_tab_label_packing.
2011-01-04 01:11:28 -05:00
Matthias Clasen
08a99e9ab3 Remove the deprecated GtkNotebook:tab-pack child property 2011-01-04 00:57:34 -05:00
Matthias Clasen
c874bba0e1 GtkNotebook: fix reference to no-longer-exiting function in docs 2011-01-03 22:55:38 -05:00
Carlos Garnacho
7e2dea1dff GtkNotebook: remove unneeded call 2011-01-04 03:06:25 +01:00
Benjamin Otte
0c285341a9 API: gdk: gdk_display_get_device_state() => gdk_device_get_position()
The API was not display-specific, but belonged to the device. Also, we
didn't find a user of the modifier mask, so we dropped it.
2010-12-27 18:46:41 +01:00
Benjamin Otte
a5f493bfad notebook: Use nondeprecated API to query coordinates 2010-12-27 00:50:30 +01:00
Matthias Clasen
9baf24f87e Add a default handler for drag_failed
And use it in notebook dnd.
2010-12-22 18:46:29 -05:00
Javier Jardón
e9a77a1535 docs: gtknotebook.c: Use accessor functions to access GtkSelectionData 2010-12-16 00:16:00 +00:00
Javier Jardón
ad4ac2182a gtk/gtknotebook.c: Use accessor functions to access GtkSelectionData 2010-12-15 23:58:15 +00:00
Carlos Garnacho
3306305fe1 GtkNotebook: Use GtkStyleContext. 2010-12-13 22:31:29 +01:00
Carlos Garnacho
517eaa55e5 GtkNotebook: Set widget state as state flags. 2010-12-04 15:38:32 +01:00
Carlos Garnacho
c9a3da5025 GtkStyleContext: s/set/add/ and s/unset/remove/ for classes/regions.
Several classes and regions may be set to GtkStyleContext, so rename
the functions to be more intuitive.
2010-12-04 15:38:24 +01:00
Carlos Garnacho
7e7347d1a0 GtkNotebook: invert tab drawing order so region flags are set correctly. 2010-12-04 15:38:10 +01:00
Carlos Garnacho
a3637ec60d s/child class/region/ everywhere.
"Child class" is an invented term anyway, and it conceptually defines
identifiable regions in widgets.
2010-12-04 15:37:35 +01:00
Carlos Garnacho
a323310c19 GtkNotebook: Set GtkChildClassFlags for tabs. 2010-12-04 15:37:10 +01:00
Tristan Van Berkom
9a80908c91 Removed size_request from GtkNotebook 2010-10-27 14:35:04 +09:00
Benjamin Otte
6e90804b30 notebook: Hi, I can't get my function prototypes right
Also, I refuse to compile with -Werror
2010-10-18 19:22:43 +02:00
Matthias Clasen
7791013754 Support GtkWidget expand properties in GtkNotebook
We expand a tab if either tab-expand is set, or the generic widget
expand property in the correct direction is set. And we do not
propagate expand flags from tab labels to the notebook, only
the expand flags from the pages.
2010-10-13 10:49:06 -04:00
Javier Jardón
5a30dad531 docs: Move documentation to inline comments: GtkComboBox 2010-10-04 02:37:42 +02:00
Ignacio Casal Quinteiro
13c4c554ef Add missing vfuncs to gtknotebook. 2010-10-03 21:48:56 +02:00
Javier Jardón
bbd80b671a docs: Move documentation to inline comments: GtkNotebook 2010-10-03 20:21:48 +02:00
Matthias Clasen
0bca60fdd3 GTK docs: various fixups 2010-10-01 13:05:12 -04:00
Benjamin Otte
6c7daaf8b9 notebook: Fix compilation warnings - missing cast 2010-09-28 18:24:34 +02:00
Matthias Clasen
f53ad33994 Remove GtkObject completely 2010-09-26 22:18:19 -04:00
Javier Jardón
eac1959d2c Move destroy signal to GtkWidget
Also make GtkWidget derive from GInitiallyUnowned
2010-09-26 22:18:18 -04:00
Benjamin Otte
92732ffea0 notebook: Use gtk_cairo_transform_to_window() 2010-09-26 15:11:46 +02:00
Benjamin Otte
d9c9259861 Move GtkSizeRequest into GtkWidget
It doesn't make sense to keep them separate as GtkSizeRequest requires a
GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have
one without the other.
It also makes the code a lot easier because no casts are required when
calling functions.

Also, the names would translate to gtk_widget_get_width() and people
agreed that this would be a too generic name, so a "preferred" was added
to the names.

So this patch moves the functions:
gtk_size_request_get_request_mode() => gtk_widget_get_request_mode()
gtk_size_request_get_width() => gtk_widget_get_preferred_width()
gtk_size_request_get_height() => gtk_widget_get_preferred_height()
gtk_size_request_get_size() => gtk_widget_get_preferred_size()
gtk_size_request_get_width_for_height() =>
  gtk_widget_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
  gtk_widget_get_preferred_height_for_width()
... and moves the corresponding vfuncs to the GtkWidgetClass.

The patch also renames the implementations of the vfuncs in widgets to
include the word "preferrred".
2010-09-26 15:11:45 +02:00
Benjamin Otte
6eb6135e2d notebook: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
1d3f6b30b0 API: Rename gtk_cairo_paint_*() to gtk_paint_*()
Large patch, but just renaming.
Indentation should still mostly be correct because I took care of
keeping the indentation for this function name.
2010-09-26 15:11:42 +02:00
Benjamin Otte
5f771c8a9f notebook: Connect to draw signal 2010-09-26 15:11:40 +02:00
Benjamin Otte
f383e1f183 notebook: Port to draw vfunc 2010-09-26 15:11:38 +02:00
Benjamin Otte
21099d31ed notebook: The drawable check is not necessary
Large patch, but that's only indentation.
2010-09-26 15:11:38 +02:00
Benjamin Otte
fadf269a36 notebook: Draw tabs and arrows with Cairo
Includes a fix to only draw the current page once during a drag
operation.
2010-09-26 15:11:38 +02:00
Benjamin Otte
ad030e1696 notebook: Simplify draw_tab function a bit
Don't keep lots of local variables that are only used once.
2010-09-26 15:11:38 +02:00
Benjamin Otte
806bcb10ff notebook: remove check for is_drawable
When we reach that code, the widget will always be drawable
2010-09-26 15:11:37 +02:00
Benjamin Otte
c46ce97145 notebook: Reorder expose function in preparation of draw vfunc 2010-09-26 15:11:37 +02:00
Benjamin Otte
f94ff0b3b9 notebook: Use a for loop when iterating over a list 2010-09-26 15:11:37 +02:00
Benjamin Otte
468e453a31 notebook: Draw focus when drawing tab
Instead of using a special function, draw the focus of a tab when the
tab actually is painted. Simplifies the code quite a bit.
2010-09-26 15:11:37 +02:00
Benjamin Otte
a5e487846a notebook: Remove useless optimization
It will become especially useless once we draw with Cairo exclusively.
2010-09-26 15:11:37 +02:00
Benjamin Otte
e8a6bad00b gtk: Don't set colormap anymore when creating GDK windows
Colormaps are about to be removed, so not using them sounds like an
awesome idea.
2010-09-26 15:11:31 +02:00
Benjamin Otte
eda14b2d47 notebook: Fix compilation warnings
A quark is not a pointer.
2010-09-26 15:02:00 +02:00
Matthias Clasen
94e9a35a16 Another since tag 2010-09-24 11:31:23 -04:00
Matthias Clasen
50971f704c Correct since tags 2010-09-24 11:29:17 -04:00
Matthias Clasen
3c19eea34b GtkNotebook: replace group by group_name
Dealing with bare pointers is problematic for language bindings,
using interned strings is much more straightforward and more than
good enough for what is needed here.

http://bugzilla.gnome.org/show_bug.cgi?id=630521
2010-09-24 11:13:30 -04:00
Matthias Clasen
b47b1428b8 GtkNotebook: remove gtk_notebook_set_window_creation_hook
http://bugzilla.gnome.org/show_bug.cgi?id=630521
2010-09-24 11:10:51 -04:00
Cody Russell
27bc88f7c2 Merge branch 'notebooks-without-mouse-scrolling' 2010-09-21 16:19:10 -05:00
Cody Russell
ad48f4d52b Remove mouse scrolling from GtkNotebook tabs. Bug #630226. 2010-09-21 16:18:22 -05:00
Matthias Clasen
e0aa12eb0a Tons of transfer annotations 2010-09-21 00:18:11 -04:00
Javier Jardón
b140884fec Use gtk_size_request_get_size() instead deprecated gtk_widget_size_request()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629598

Signed-off-by: Javier Jardón <jjardon@gnome.org>
Signed-off-by: Tristan Van Berkom <tristanvb@openismus.com>
2010-09-15 03:02:58 +02:00
Javier Jardón
9e81022bf6 Use gtk_size_request_get_size() instead deprecated gtk_widget_get_child_requisition()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629177
2010-09-13 21:26:01 +02:00
Colin Walters
913cdf3be7 GDK: Prefix key names with KEY_
The keysyms create a lot of potential namespace conflicts for
C, and are especially problematic for introspection, where we take
constants into the namespace, so GDK_Display conflicts with GdkDisplay.

For C application compatiblity, add gdkkeysyms-compat.h which uses
the old names.

Just one user in GTK+ continues to use gdkkeysyms-compat.h, which is
the gtkimcontextsimple.c, since porting that requires porting more
custom Perl code.
2010-09-08 18:51:44 -04:00
Javier Jardón
efaed1b8f1 gtk/gtknotebook.c: use accessor functions to access GtkWidget 2010-09-08 21:13:04 +02:00
Javier Jardón
bc366cef52 gtknotebook: Do not mention deprecated API 2010-09-08 17:46:11 +02:00
Tristan Van Berkom
f2279d5e51 Fixed GtkNotebook to not consult GtkWidget->requisition directly
GtkNotebook was filling widget->requisition directly at "size-request"
time instead of filling in the *requsition argument, also (more importantly)
at size_allocate time GtkNotebook was consulting the action widget's
widget->requisition directly instead of safely calling
gtk_widget_get_child_requisition(). This commit closes bgo #628068.
2010-09-02 13:50:27 +09:00
Javier Jardón
1e5d7c0225 Use GtkFooPrivate instead GtkFooPriv 2010-08-27 04:48:23 +02:00
Javier Jardón
f91e5e2ac9 gtk/gtknotebook.c: Use accessor functions to access GtkWindow 2010-08-23 20:19:03 +02:00
Philip Withnall
3eb197b51f Bug 596125 — Property string fixes 2010-08-10 09:23:49 +01:00
Sam Thursfield
a2b72c5953 Add missing accessors for notebook details
The ms-windows theme engine needs to access the tab-{h,v}border,
so add accessors. Bug 625655.
2010-08-09 21:20:07 -04:00
Christian Dywan
1c5ee1df12 Correct marshaller for switch-page and adjust emission from menu
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=624687
2010-07-23 13:21:33 +02:00
Christian Persch
1af1362a36 gtknotebook: Fix critical warnings on scroll events
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=604391
2010-07-19 15:28:03 +02:00
Javier Jardón
63d3b197c2 Add _gtk_bin_set_widget() internal function 2010-07-13 19:40:47 +02:00
Javier Jardón
4427760bcc Use GtkBin accessors 2010-07-13 19:40:47 +02:00
Javier Jardón
3a10216dd0 Use accessor functions to acces GtkContainer 2010-07-13 19:40:46 +02:00
Christian Dywan
335549b46a Move definition of GtkNotebookPage out of the header 2010-07-13 18:47:45 +02:00
Javier Jardón
33960b737d GtkNotebook: Move public members to private structure 2010-07-13 18:16:06 +02:00
Christian Dywan
828f5cbe2e Change GtkNotebookPage in switch-page into GtkWidget 2010-07-13 17:05:22 +02:00
Christian Dywan
04c54efe5c Deprecate GtkNotebookPage as used in switch-page
Fixes: 618327
2010-07-13 16:49:53 +02:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
Xan Lopez
533ea97c67 Remove leftover uses/references of GtkNotebook::group-id 2010-07-02 22:38:39 +02:00
Matthias Clasen
67cd929267 Remove deprecated notebook api 2010-06-26 16:29:43 -04:00
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
Javier Jardón
0de8601327 Use accessor functions to access GtkLabel variables 2010-05-03 01:51:23 +02:00
Christian Dywan
2d84d88539 Remove internal GtkNotebook tab homogeneousnes and border helpers 2010-05-03 01:51:19 +02:00
Christian Dywan
c4b3b13f9d Remove deprecated GtkNotebook functions 2010-05-03 01:39:50 +02:00
Sjoerd Simons
a957d4593e Prevent the destruction of the menu label on page removal
In certain cases the menu label of a notebook page will be reused after the
page was removed from the notebook, for instance when a page is dragged from
one notebook to another. For such cases make sure that the menu label isn't
destroyed as part of destroying the menu item it was in.
2010-03-22 14:11:05 -04:00
Christian Dywan
c1a3a0fd9b Improve docs of gtk_notebook_set_tab_label_packing
Use the term tab label rather than bookmark and point out
that packing type is deprecated.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=612575
2010-03-12 17:56:21 +01:00
Javier Jardón
32b9aeaadd Don't use GTK_WIDGET_STATE in internal code anymore
Use gtk_widget_get/set_state() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-09 02:40:17 +01:00