Commit Graph

669 Commits

Author SHA1 Message Date
William Jon McCann
3b3d8ca456 docs: Use "#" for refsect2 instead of ## 2014-02-04 21:00:58 -05:00
Matthias Clasen
09d1b28249 docs: Convert to markdown
Specifically, switch to using markdown syntax for sections.
2014-02-02 00:30:27 -05:00
William Jon McCann
4c8bd8e7cf docs: Identify examples that are C code
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
768bc44081 docs: use |[ ]| instead of <programlisting></programlisting>
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
6fd7e547c5 notebook: don't use a null page 2014-01-24 18:41:22 -05:00
William Jon McCann
66f8026622 notebook: add a style class when the child tab is reorderable 2014-01-24 17:27:27 -05:00
William Jon McCann
3437f83ff3 notebook: add a style for prelighted labels 2014-01-24 13:15:44 -05:00
Paolo Borelli
609ddec1f8 Always return FALSE from the notebook leave_notify handler
As discussed on IRC with Benjamin, this should not make much
difference in practice, but it is more correct
2014-01-14 20:29:46 +01:00
Paolo Borelli
84b44dd2ac Readd line removed by mistake in the previous commit 2014-01-14 20:23:52 +01:00
Paolo Borelli
4a3f21b693 Prelight notebook tab
Set the prelight state when hovering a notebook tab with the mouse.

https://bugzilla.gnome.org/show_bug.cgi?id=711233
2014-01-14 20:18:54 +01:00
Matthias Clasen
64855f1295 GtkNotebook: Fix a problem with tab states
When replacing the tab label, we were not adding the
active-page style class. Fix that.
2014-01-04 13:01:49 -05:00
Bastien Nocera
438cd857c4 all: Add names to timeouts
Add names to every timeout we setup, so it's easier to track their
usage, and debug possible misbehaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=710651
2013-10-23 13:31:18 +02:00
William Jon McCann
05b1ea84b4 notebook: inform the theme whether show-borders was set
So that it can draw a border or not. If show-borders=true then
the notebook will have GTK_STYLE_CLASS_FRAME.
2013-10-16 12:03:33 -04:00
William Jon McCann
6f17c408e6 notebook: inform the theme to draw borders when requested
When the show-border property is TRUE ask the theme to draw
borders on the notebook header.
2013-10-04 18:14:25 -04:00
William Jon McCann
053433010b notebook: add style classes for orientation to the header 2013-10-04 18:14:25 -04:00
William Jon McCann
db60046af4 notebook: correctly define the header region
Correctly define the header region to only be the area under the
tabs.
2013-10-04 18:14:25 -04:00
William Jon McCann
e9b9fd20b9 notebook: Add a style property for whether to draw a tab gap
Add a has-tab-gap style property to GtkNotebook so that we can
disable drawing the gap between tabs and the page in the Adwaita
theme without breaking existing themes.

https://bugzilla.gnome.org/show_bug.cgi?id=707920
2013-10-02 10:51:16 -04:00
William Jon McCann
b609377e3e notebook: Fix rounding error in vertical alignment of arrow
https://bugzilla.gnome.org/show_bug.cgi?id=707920
2013-10-02 10:51:16 -04:00
William Jon McCann
e07fec3e83 notebook: Make notebook scroll arrows honor initial gap setting
So that they can be styled so they are not right on the edge.

https://bugzilla.gnome.org/show_bug.cgi?id=707920
2013-10-02 10:51:16 -04:00
William Jon McCann
81b0808849 notebook: Use initial-gap on both edges of the tab header
https://bugzilla.gnome.org/show_bug.cgi?id=707920
2013-10-02 10:51:15 -04:00
Cosimo Cecchi
71ad9a8fdd notebook: render a frame and background in the header
And use the "header" style class to do that.
This allows themes to set e.g. the background of the tab header
differently.

Themes will need slight adjustment to make things appear
as before.

https://bugzilla.gnome.org/show_bug.cgi?id=643914
2013-09-26 19:27:54 -04:00
Cosimo Cecchi
a2ed88b3ee Allow active tab children to be styled
This allows one to style the children of an active
tab label from CSS.

https://bugzilla.gnome.org/show_bug.cgi?id=691163
2013-09-26 19:19:53 -04:00
Matthias Clasen
bd1df33798 Trivial: correct vfunc signatures
Harmless confusion between gint and gboolean
https://bugzilla.gnome.org/show_bug.cgi?id=697031
2013-09-26 19:16:14 -04:00
Matthias Clasen
624ec0fb7d Add a style class for context menus
Attached widgets inherit from the style of the widget they are
attached to. This can sometimes have unintended consequences,
like a context menu in the main view of gedit inheriting the font
that is configured for documents, or the context menu of the preview
in the font chooser coming up with humongous font size.

To fix this problem, we introduce a context menu style class
and use it for all menus that are used like that. The theme
can then set a font for this style class.

https://bugzilla.gnome.org/show_bug.cgi?id=697127
2013-08-18 13:46:48 -04:00
Jasper St. Pierre
030b62d122 gtkdnd: Introduce a new API for more accurate drag origin data
When trying to drag, we currently the position of the first motion
event to determine where the drag came from. This might be alright
in the case of the old animation, but the data will be inaccurate
if the user has moved the pointer quite a bit since pressing the
cursor to start dragging. While we could monkey patch the GdkEvent
at the widget layer, this is unintuitive and strange.

Add a new API that takes a set of pointer coordinates describing
the origin of the drag. Additionally, adapt most widgets to use
it and use it with correct coordinates.

https://bugzilla.gnome.org/show_bug.cgi?id=705605
2013-08-14 07:12:52 -04:00
William Jon McCann
57fc8763e9 Deprecate and ignore the timeout-initial and timeout-repeat settings 2013-07-11 17:08:15 -04:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
William Jon McCann
b101d465be Deprecate and ignore gtk-keynav-cursor-only and gtk-keynav-wrap-around 2013-06-26 15:33:10 -04:00
Matthias Clasen
3b4804bbf1 Always use gint for border_width
This avoids an evil trap when doing MAX (..., ... - 2 * border_width)
and the expression on the right gets promoted to unsigned, instead
of going negative as you would expect.
https://bugzilla.gnome.org/show_bug.cgi?id=699633
2013-05-04 19:21:56 -04:00
Benjamin Otte
1349292e47 widget: Adapt _gtk_widget_get_preferred_size_for_size()
... for baseline support byu taking two extra (possible NULL) arguments.
2013-05-01 16:41:11 +02:00
Matthias Clasen
af49dd33cf GtkNotebook: Consistent boolean handling
Normalize boolean parameters in gtk_notebook_set_tab_reorderable and
gtk_notebook_set_tab_detachable before comparing them. Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=697196
2013-04-24 19:58:22 -04:00
Benjamin Otte
3450388ff0 sizerequest: Split out a common function 2013-04-22 18:29:01 -04:00
Alexander Larsson
3d4cd4db3e Add gtk_widget_(un)register_window
This replaces the previously hardcoded calls to gdk_window_set_user_data,
and also lets us track which windows are a part of a widget. Old code
should continue working as is, but new features that require the
windows may not work perfectly.

We need this for the transparent widget support to work, as we need
to specially mark the windows of child widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=687842
2013-02-07 11:11:37 +01:00
Matthias Clasen
52af9aede6 GtkNotebook: Clarify a switch statement
We were intentionally falling through here, this commit
just adds comments to make that explicit.
2012-11-29 23:10:34 -05:00
Cosimo Cecchi
852d4d618c notebook: return TRUE for drag-motion event when over tabs
The GtkNotebook drag-motion event handler may install a timeout when
hovering over a tab, in order to switch to it.
On the other hand it's desirable for applications to use the empty tab
area as a drop target, so the drag-motion handler returns FALSE
(also in case it installs the switch tab timeout), as explained in
https://bugzilla.gnome.org/show_bug.cgi?id=350665.

Unfortunately, applications can use the tab label widget (or a child
of it) as a different drop target area, and install their own
drag-motion handler there.
In this scenario, the timeout will still be installed by GtkNotebook's
handler, but since it returns FALSE, it will never get the matching
drag-leave event, causing it to trigger also when the mouse pointer
moved elsewhere before it expired.

Fix this by returning TRUE from drag-motion when the event is over a
tab. Note that this makes automatic tab switching not work anymore when
drag and drop is handled in the tab label widget; applications are
expected to also handle tab switching if desired in such a case.

https://bugzilla.gnome.org/show_bug.cgi?id=684415
2012-10-22 18:39:37 -04:00
Cosimo Cecchi
42da600eb1 notebook: consolidate code to remove the switch tab timer
https://bugzilla.gnome.org/show_bug.cgi?id=684415
2012-10-22 18:37:47 -04:00
Cosimo Cecchi
c1218f964a notebook: restore previous behaviour wrt. unparenting of tab labels
When the tab label gets removed from the notebook on widget
desctruction, we should still unconditionally unparent it from the
notebook, since failing to do so will keep a stray reference alive.

In case applications rely on the tab label being destroyed to release
other references (e.g. because the tab label is a custom object, or
another object's lifecycle is tied to it using g_object_set_data_full()),
this will also possibly cause other references to get leaked.
In Nautilus, the result was we were failing to release the reference to
a NautilusWindowSlot, and other parts of the application relied
on it being destroyed at a specific time instead, causing the
application to crash when closing a window.

This is a regression from commit
325cf071d1.

This commit restores the previous unparenting behavior in case we're not
in a DnD operation.

https://bugzilla.gnome.org/show_bug.cgi?id=680349
2012-07-31 20:17:54 +02:00
Cosimo Cecchi
f70fc49ebc docs: fix a number of typos and obsolete references 2012-07-02 10:41:11 -04:00
Matthias Clasen
cea4b80096 Fix a compiler warning
This was introduced in the previous commit.
2012-06-23 13:07:47 -04:00
Matthias Clasen
3056324570 GtkNotebook: Fix reverse tab order
When using Shift-Tab to move the focus out of page content onto
the tab label, we end up in a situation where both Tab and Shift-Tab
move focus back into the page, which is not really what is expected
when the notebook is part of a dialog.

Instead, arrange things so that using Shift-Tab with focus on a
tab label moves the focus out of the notebook.

http://bugzilla.gnome.org/show_bug.cgi?id=669986
2012-06-23 12:37:20 -04:00
Matthias Clasen
325cf071d1 GtkNotebook: Maintain invariants during tab dnd
It turns out that we can end up removing a notebook child while
the tab is still 'detached'. Child removal causes
gtk_notebook_remove_tab_label() to be called on the tab label,
but that function did not deal with the eventuality that the tab
label may be a child of the dnd window.

http://bugzilla.gnome.org/show_bug.cgi?id=677943
2012-06-23 10:04:14 -04:00
Cosimo Cecchi
10a4771ae3 notebook: fix size requisition for the initial_gap style property
This is probably going to be replaced by something different soon, but
in the meantime, fix this annoying bug, visible e.g. in widget-factory
for left/right tab examples.
2012-05-30 18:02:42 -04:00
Matthias Clasen
d44edc1f7d Revert "WIP: make GtkNotebook window-draggable"
This reverts commit b3a66c59ad.
2012-04-28 02:06:37 -04:00
Diego Escalante Urrelo
b3a66c59ad WIP: make GtkNotebook window-draggable
https://bugzilla.gnome.org/show_bug.cgi?id=672427

https://bugzilla.gnome.org/show_bug.cgi?id=674587
2012-04-28 02:01:16 -04:00
Benjamin Otte
ece9d2fd92 gtk: Make widget only invalidate widget positions
Instead of resetting them completely
2012-04-17 08:59:10 +02:00
Benjamin Otte
461803e407 gtk: Get gtkwidgetpath.h includes out of the public headers
and include them in the C files instead.
2012-03-19 02:26:16 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Claudio Saavedra
cfe65a0d6c GtkNotebook: and another fix
https://bugzilla.gnome.org/show_bug.cgi?id=669116
2012-02-16 12:33:26 +02:00
Claudio Saavedra
ccf7867c35 GtkNotebook: fix one child-notify emission
Forgot to increase the counter in the for loop, doing it now.

https://bugzilla.gnome.org/show_bug.cgi?id=669116
2012-02-16 12:28:46 +02:00
Claudio Saavedra
347328adb0 GtkNotebook: emit child-notify::position on drag 'n drop reorder
https://bugzilla.gnome.org/show_bug.cgi?id=669116
2012-02-15 01:05:12 +02:00
Claudio Saavedra
cb775a6a6d GtkNotebook: emit child-notify::position on page add/removal
For each page added/removed, notify all the other children changing
position.

https://bugzilla.gnome.org/show_bug.cgi?id=669116
2012-02-15 01:05:12 +02:00
Claudio Saavedra
e2339f5ebd GtkNotebook: emit child-notify::position a few more times
When moving a page around, all children changing their position
need to be notified.

There are still other places where proper notification is missing
(drag 'n drop, etc.)

https://bugzilla.gnome.org/show_bug.cgi?id=669116
2012-02-10 16:39:44 +02:00
Carlos Garcia Campos
594903ecde gtknotebook: Use symbolic names for button numbers 2012-01-27 09:47:43 +01:00
Cosimo Cecchi
637e6688da notebook: fixup previous commit
Oops, I hit push too early.
2012-01-18 16:14:31 -05:00
Cosimo Cecchi
70cf23a729 notebook: don't force ACTIVE state flag on the label for active tab
This is just wrong, since it's not the tab label being active, but the
tab itself.
2012-01-18 16:13:25 -05:00
Matthias Clasen
cf172a5873 Revert "GtkNotebook: fix crash when DnD tabs between windows"
This reverts commit eeb9de80e1.
2012-01-15 18:54:05 -05:00
Xan Lopez
eeb9de80e1 GtkNotebook: fix crash when DnD tabs between windows
When doing DnD between windows the tab label is set as the child of
the DnD info window. If this is happening the remove method of
GtkNotebook should not unparent the tab label, since it's been already
unparented, belongs to the DnD window and will be properly destroyed
when the DnD is over.

https://bugzilla.gnome.org/show_bug.cgi?id=639875
2012-01-04 08:48:46 +01:00
Rui Matos
8b444d1c03 notebook: Use the widget state flags as a base for drawing 2011-12-19 19:21:16 +00:00
Matthias Clasen
d978ed85ae Remove an unused variable 2011-12-05 18:07:41 -05:00
Carlos Garnacho
029a884d9e gtk,notebook: Invalidate the gap side when reordering tabs
This narrow area is invalidated so the gap follows the tab
being reordered.
2011-12-05 21:23:23 +01:00
Alexander Larsson
fd06890354 notebook: Make the tab reordering dnd window transparent 2011-12-05 21:15:06 +01:00
Cosimo Cecchi
79bbce5577 notebook: use the current page allocation when computing the redraw area
Instead of taking the first page and trying to adjust the rect with
random padding values, take the current page, as it's always guaranteed
to be at least as tall as inactive tabs.
This fixes some annoying 1px drawing artifacts while switching tabs when
the theme disables notebook padding.

https://bugzilla.gnome.org/show_bug.cgi?id=664494
2011-11-21 14:19:36 -05:00
Cosimo Cecchi
f01162c727 notebook: properly subtract the initial_gap width from the tab space
Instead of modifying the allocation.

https://bugzilla.gnome.org/show_bug.cgi?id=664494
2011-11-21 14:19:36 -05:00
Cosimo Cecchi
009224a80e notebook: make sure to allocate the CSS border width
Instead of taking only the CSS padding into account when allocating the
notebook children, also allocate the border width.

https://bugzilla.gnome.org/show_bug.cgi?id=664342
2011-11-20 16:03:31 -05:00
Michael Natterer
0308352417 notebook: don't leak the action widgets
The notebook owns them, so it must destroy them in destroy().
(cherry picked from commit 87ebfb19fd)
2011-11-17 01:07:37 +01:00
Cosimo Cecchi
ccdc3c1802 notebook: update tab area allocation when switching page
When the active page is switched, it's important
gtk_notebook_pages_allocate() is called after the bulk of
gtk_notebook_real_switch_page() is run, as the former allocates a
different space according to the currently active tab, which is set by
the latter.
gtk_notebook_pages_allocate() already calls gtk_notebook_redraw_tabs()
when the allocation changes, so just move its call down to
gtk_notebook_real_switch_page() to fix the bug.

https://bugzilla.gnome.org/show_bug.cgi?id=662629
2011-10-24 13:19:39 -04:00
Cosimo Cecchi
bdfa05bc81 notebook: don't forget to prepare the tab style context before drawing
The previous commit a9affcdd3f
accidentally removed the call to notebook_tab_prepare_style_context()
2011-09-29 01:49:55 -04:00
Benjamin Otte
a9affcdd3f notebook: Remove unused variables 2011-09-29 04:24:02 +02:00
Cosimo Cecchi
63124e81b6 notebook: vborder/hborder deprecations are Since: 3.4, not 3.2 2011-09-27 13:46:01 -04:00
Cosimo Cecchi
c2f5d3d8b0 notebook: add top/bottom/left/right style classes to the tab region
When we use the style context to get information for the tab region,
also add a style class to indicate its position, so that the relevant
information is pulled off from the theme.

https://bugzilla.gnome.org/show_bug.cgi?id=659777
2011-09-27 13:43:21 -04:00
Cosimo Cecchi
d6a58e5bd3 notebook: unconditionally apply padding to the tab content
Not only when on left or top, otherwise the other position look
off-centered.

https://bugzilla.gnome.org/show_bug.cgi?id=659777
2011-09-27 13:43:21 -04:00
Cosimo Cecchi
34ee6d08bb notebook: really deprecate tab_vborder and tab_hborder
The setter for this was deprecated in 2.x and removed in 3.0.
I don't see any reason why we should hardcode 2px for this value;
instead, deprecated the getter and make it always return zero, and stop
using the variables internally.

https://bugzilla.gnome.org/show_bug.cgi?id=659777
2011-09-27 13:43:21 -04:00
Cosimo Cecchi
2500a95fad notebook: allow using different padding values for the active tab state
The code before was basically adding and removing the same padding value
in two different places during the allocation cycle.
Instead, what we want to do is to offset the inactive tab allocation by
the difference with the active tab padding, to ensure the tab content is
always drawn centered and in the right position.

https://bugzilla.gnome.org/show_bug.cgi?id=659777
2011-09-27 13:43:21 -04:00
Cosimo Cecchi
d4f83cdfb6 notebook: use the current state to get the padding values
We want to enable the use of different padding values between active and
inactive tabs, so that the two are completely separated (but limited by
the active tab size).
This way themes can decide how bigger the active tab is drawn compared
to the normal one just specifying a different padding value from the
CSS, like this:

.notebook tab {
  padding: 2;
}

.notebook tab:active {
  padding: 4;
}

As a first step, fetch the padding values with the right state flags
from GtkStyleContext.

https://bugzilla.gnome.org/show_bug.cgi?id=659777
2011-09-27 13:43:21 -04:00
Michael Natterer
2d3db3421f Bug 659406 - Abstract what triggers a context menu
Add gdk_event_triggers_context_menu(), using the new modifier
abstraction API. Remove _gtk_button_event_triggers_context_menu()
and port all callers.
2011-09-27 15:45:18 +02:00
Michael Natterer
b663f3a00b Bug 659406 - Abstract what triggers a context menu
Add _gtk_button_event_triggers_context_menu() and use it instead
of checking for event->button == 3, so context menus are invoked
correctly on the Mac.
2011-09-26 16:01:50 +02:00
Benjamin Otte
e11e51c252 notebook: Fix child property setters causing underallocations
Don't randomly allocate around, queue resizes instead.
2011-08-27 02:47:51 +02:00
Colin Walters
c8fdd5e847 Squash two compilation warnings about possibly-uninitialzed 2011-08-25 14:47:21 -04:00
Paolo Borelli
508353fd15 Do not manually create empty label
gtk_notebook_update_labels will take care of creating it if needed.
2011-08-15 15:08:28 +02:00
Matthias Clasen
2ba9c4b4a7 Make focus rectangles optional
This commit introduces a new setting, gtk-visible-focus, backed
by the Gtk/VisibleFocus X setting. Its three values control how
focus rectangles are displayed.

'always' is equivalent to the traditional GTK+ behaviour of always
rendering focus rectangles.

'never' does what it says, and is intended for keyboardless
situations, e.g. tablets.

'automatic' hides focus rectangles initially, until the user
interacts with the keyboard, at which point focus rectangles
become visible.

https://bugzilla.gnome.org/show_bug.cgi?id=649567
2011-08-10 16:34:20 +02:00
Benjamin Otte
ebadb36962 notebook: Remove unused private member variable 2011-07-20 02:36:44 +02:00
Benjamin Otte
1cdb47d960 notebook: Remove the homogenous private member variable
It's unused and therefor always FALSE, so we can remove the parts of the
code that branch based on it.
2011-07-19 12:53:06 +02:00
Matthias Clasen
318192b937 Convert GailNotebook to GtkNotebookAccessible 2011-07-05 16:08:56 -04:00
Paolo Borelli
399de11116 Speed up page insertion
Make sure to call widget_set_child_visible(false) on all tabs except the
current before calling widget_set_parent.
2011-06-26 20:41:21 +02:00
Javier Jardón
bf0d8402f5 gtk: Use const instead G_CONST_RETURN 2011-06-10 13:07:54 +01: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
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
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
Benjamin Otte
5642703b0e notebook: Match horizontal and vertical code paths
I have no idea what this code does, but it looks better now. :o
2011-04-29 11:05:37 +02:00
Benjamin Otte
8e1714d59b notebook: Respect left border when allocating tab widgets
This mirrors the code for the other tab locations.
2011-04-29 11:05:36 +02:00
Benjamin Otte
409143637f notebook: Respect padding when computing tabs for left/right
This mirrors the top/bottom code
2011-04-29 11:05:36 +02:00
Benjamin Otte
9a4aec1446 Don't adjust for values that we have previously adjusted for
The padding had been taken into account by the computation of
priv->allocation, so don't compute it twice.
2011-04-29 11:05:36 +02:00
Benjamin Otte
02b14ffad9 notebook: Use the right padding for inactive tabs 2011-04-29 08:48:36 +02:00
Benjamin Otte
7a322193e8 notebook: Warn if builder file defines multiple tab widgets per page
Glade causes such files when a notebook page has no content. And it's
especially bad because the last tab widget wins, so the label displayed
in Glade will not be what you see when you run the app.
2011-04-28 00:54:34 +02:00
Paolo Borelli
c4e17bb148 Do not leak list when drawing notebook.
When we construct the list in the other order we must free it.

https://bugzilla.gnome.org/show_bug.cgi?id=646886
2011-04-08 20:21:22 -04:00
Benjamin Otte
ea928e4212 notebook: Only reset style on tab labels when it actually changes 2011-03-27 00:48:25 +01:00
Cosimo Cecchi
6e1aa0e0a9 notebook: don't forget to reset the style after setting show-tabs
This fixes a regression after commit
b04f4c536a
2011-03-17 17:27:37 -04:00
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