Commit Graph

400 Commits

Author SHA1 Message Date
Benjamin Otte
4dee06e04f spinbutton: Port the buttons to gadgets 2015-12-15 08:41:16 -05:00
Benjamin Otte
ad22612ab2 iconhelper: Require passing a cssnode to the constructor
Note that we don't use it yet.
2015-12-15 08:41:16 -05:00
Benjamin Otte
971a277419 cssnode: Change style-changed signal
Instead of having old and new style, now have a GtkCssStyleChange opaque
object that will compute the changes you are interested in for you.

This simplifies change signal handlers quite a bit and avoids lots of
repeated computation in every signal handler.
2015-12-12 02:16:04 +01:00
Benjamin Otte
ccfc4d3f12 iconhelper: Remove the context argument
Instead, use the widget's context.
2015-12-09 13:30:40 +01:00
Benjamin Otte
e95e2d5048 iconhelper: Get rid of _gtk_icon_helper_set_window()
Instead use the window of the owner widget.
2015-12-09 13:30:40 +01:00
Benjamin Otte
c9d1a45d30 iconhelper: Require a widget as construction argument
Note that the caller needs to ensure the widget lives as long as the
iconhelper as the iconhelper will not ref the widget.
2015-12-09 13:30:40 +01:00
Benjamin Otte
3513e5e87b Chain up in state_flags_changed
When introducing handlers for state_flags_changed in the node
transitions, chaining up was forgotten.
2015-12-02 04:36:31 +01:00
Timm Bäder
6489ec440f GtkSpinButton: Update node state on button release 2015-11-20 20:32:15 +01:00
Matthias Clasen
cf7bb4f2aa spin button: Fix initial button state
We can't use up_panel and down_panel as differentiators for the buttons,
because these window system resources don't exist before realize().
Just use a one-off enum for this purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=758094
2015-11-20 11:40:55 -05:00
Matthias Clasen
43f822e70f Annotate deprecated style properties
Use G_PARAM_DEPRECATED with deprecated style properties.
This will make it easier to identify and remove such stale
properties from css, since it will now trigger warnings.
2015-11-16 15:13:33 -05:00
Matthias Clasen
ed2c14f4aa spinbutton: Document some style properties as deprecated
No code change.
2015-11-16 07:20:18 -05:00
Matthias Clasen
a24de82ced spinbutton: update node state more often
We need to update the entry_node state, and we should
update the node state initially.
2015-11-14 23:18:17 -05:00
Benjamin Otte
37b4b60e91 spinbutton: Use right state when querying padding 2015-11-06 18:59:15 +01:00
Matthias Clasen
65d959bbc8 spin button: Add diagrams to CSS documentation 2015-11-03 14:27:35 -05:00
Benjamin Otte
fc6f41c751 spinbutton: Don't set .entry
Also fix Adwaita to not use .entry anymore
2015-10-29 16:03:15 +01:00
Matthias Clasen
bb7d7851ac entry, spinbutton: Finish css node conversion
This commit creates entry and button subnodes for the buttons
in GtkSpinButton. The nodes are ordered like this for horizontal

  spinbutton
  + entry
    + image.left
    + image.right
    + progress
  + button.down
  + button.up

and like this for vertical ones:

  spinbutton
  + button.down
  + entry
  + button.up

This arrangement requires cooperation from GtkEntry to place
the entry subnodes correctly, and some small changes in the theme.

This commit also fixes progress rendering in vertical spin buttons.
2015-10-28 23:43:32 -04:00
Matthias Clasen
ebcad63e31 wip: spinbutton 2015-10-28 21:55:13 -04:00
Matthias Clasen
811c1c9484 spinbutton: Trivial cleanup
Use g_clear_object in a few places.
2015-10-28 21:55:13 -04:00
Alexander Larsson
d5f1754981 gtk: Stop setting GDK_EXPOSURE_MASK on random widgets
These days exposure happens only on the native windows (generally the
toplevel window) and is propagated down recursively. The expose event
is only useful for backwards compat, and in fact, for double buffered
widgets we totally ignore the event (and non-double buffering breaks
on wayland).

So, by not setting the mask we avoid emitting these events and then
later ignoring them.

We still keep it on eventbox, fixed and layout as these are used
in weird ways that want backwards compat.
2015-09-14 11:01:13 +02:00
Matthias Clasen
f263c11ce8 spin button: Add Home and End as key bindings
Make these go to the lower/upper boundary of the adjustment, like
Ctrl-PageUp/PageDown already do.
https://bugzilla.gnome.org/show_bug.cgi?id=309300
2015-07-19 17:17:53 -04:00
Matthias Clasen
d90847b20e GtkSpinButton: Stop using gtk_adjustment_value_changed
This is just an unnecessary indirection.
2015-05-10 02:34:33 -04:00
Matthias Clasen
eea16f03f5 Stop using GDK_POINTER_MOTION_HINT_MASK in widgets
It is deprecated and no longer needed, and,as observed in
https://bugzilla.gnome.org/show_bug.cgi?id=746253 it
interferes with turning off event compression.
2015-03-22 17:33:38 -04:00
Benjamin Otte
a24aee6bb2 spinbutton: Fix get_text_area_size for vertical spinbuttons
Commit c5905b13b9 changed the semantics of
this vfunc and get_entry_size but I only fixed one of them in the
spinbutton subclass.

https://bugzilla.gnome.org/show_bug.cgi?id=746282
2015-03-16 15:24:16 +01:00
Benjamin Otte
c5905b13b9 entry: Make code do what it's meant to do
With the 3.0 transition, this code went from just querying the entry's
height request to doing a full size request.
Then it got code to revert the features that a full size request does.
And then it grew code that manually computed the baseline.

Avoid this and just do what happened back in the days: Do a regular
height request.

This changes the semantics of the get_frame_size() vfunc wrt its
behavior towards subclasses overwriting the get_height() vfuncs, but I'm
happy to live with that.
2015-03-14 15:46:13 +01:00
Matthias Clasen
80dbb4186a GtkSpinButton: Use the proper state
Use the style contexts current state when querying it.
2014-11-26 18:38:43 -05:00
Matthias Clasen
9ca9fccace GtkSpinButton: Set the screen on the panel contexts
Failure to do so results in custom styling leaking through in
the inspector. This is pretty obvious, now that the inspector
is using a separate display connection and is generally isolated
from style changes.
2014-10-25 13:31:57 -04:00
Matthias Clasen
8889565735 GtkSpinButton: Simplify code
No need to explicitly specify a parser function, it will be
correctly guessed from the property type.
2014-10-19 22:07:19 -04:00
Benjamin Otte
998feeb2bc spinbutton: Set the correct state on the button contexts
With the recent save-is-child changes, using
  gtk_style_context_get_padding (context, different_state)
will now open a subelement.

This is not what we want, so we check the state whenever we get the
button contexts.
2014-10-16 17:18:34 +02:00
Carlos Garnacho
b7412a1d9b spinbutton: Make the swipe gesture only work on touch devices
This code was relying on the previous GtkGestureSingle::touch-only default
value.

https://bugzilla.gnome.org/show_bug.cgi?id=734285
2014-08-15 13:53:39 +02:00
Debarshi Ray
137abd6f70 GtkSpinButton: Prevent public API from unsetting the adjustment
A spin button really needs an adjustment to work. So don't let the
user unset the adjustment by passing NULL to
gtk_spin_button_set_adjustment.

https://bugzilla.gnome.org/show_bug.cgi?id=734660
2014-08-13 23:42:11 -04:00
Debarshi Ray
1e304e6deb GtkSpinButton: Always emit value-changed when the adjustment is changed
Changing adjustment via the property setter would not emit
value-changed, however changing it via gtk_spin_button_configure would.

This inconsistency had the following side-effects:

  - Setting an adjustment with a different value would not update the
    value shown by the spin button.

  - Creating a spin button like this (common in GtkBuilder XML) will
    not show the initial value:
      g_object_new (GTK_TYPE_SPIN_BUTTON, "adjustment", adj, NULL);

Let's use the same code path (ie. gtk_spin_button_configure) for all
public facing API for setting adjustment. The code that handled the
details of swapping out the old adjustment with the new has been split
into an unset_adjustment method and the rest has been folded into
gtk_spin_button_configure.

A spin button really needs an adjustment to work, so we don't need
most of the NULL checks. However we do need to check in
unset_adjustment because setting a new adjustment during object
creation might try to unset a non-existent one.

https://bugzilla.gnome.org/show_bug.cgi?id=734660
2014-08-13 23:42:11 -04:00
Debarshi Ray
225bb95795 GtkSpinButton: Only notify 'adjustment' if the property changed
https://bugzilla.gnome.org/show_bug.cgi?id=734649
2014-08-12 11:54:29 +02:00
Gergely POLONKAI
7f7084f7f5 GtkSpinButton: Document some signals
Based on a patch by Gergely Polonkai,
https://bugzilla.gnome.org/show_bug.cgi?id=733174
2014-07-19 18:34:58 -04:00
Matthias Clasen
f7c838ce5f Trivial: Use the canonical signal name 2014-07-19 18:34:58 -04:00
Matthias Clasen
87b7103db1 GtkSpinButton: Set orientable style classes initially
This was an omission, horizontal/vertical would only be set
when the orientation is changed.
2014-07-18 19:39:56 -04:00
Matthias Clasen
d03752cdcc GtkSpinButton: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:31:10 -04:00
Carlos Garnacho
d05a9f9a7b gesture: Replace gtk_gesture_attach/detach with event controller API
Event controllers now auto-attach, and the GtkCapturePhase only determines
when are events dispatched, but all controllers are managed by the widget wrt
grabs.

All callers have been updated.
2014-05-27 17:47:12 +02:00
Carlos Garnacho
60e15deb83 spinbutton: Avoid touch text handles to pop up
Those get in the middle more than help on these widgets, the widget
is already packed with clickable areas and having handles (and their
invisible clickable area around) hovering above don't help, plus the
purpose in most likely numeric values is a bit doubtful.

All touch events are either consumed by the up/down panels, or
the swipe gesture, all GtkEntry handling of touch events on the text
window is avoided, so handles to not appear anymore.
2014-05-23 19:54:33 +02:00
Carlos Garnacho
d59c909663 spinbutton: Use GTK_PHASE_CAPTURE for touch swipes
The gesture must be able to catch first events for it to be seen
as recognized in event handlers.
2014-05-23 19:54:33 +02:00
Carlos Garnacho
d559cade42 spinbutton: Attach "swipe to spin" controllers to the bubble phase
It is unnecessary to have those process events manually, just attach
those to the bubble phase.
2014-05-23 19:54:31 +02:00
Carlos Garnacho
5369c77029 gesture: Simplify gesture/widget interaction public API
The propagation phase property/methods in GtkEventController are gone,
This is now set directly on the GtkWidget add/remove controller API,
which has been made private.

The only public bit now are the new functions gtk_gesture_attach() and
gtk_gesture_detach() that will use the private API underneath.

All callers have been updated.
2014-05-23 19:54:29 +02:00
Matthias Clasen
93b7883372 GtkSpinButton: Don't leak the gestures 2014-05-23 19:54:28 +02:00
Carlos Garnacho
6296aa84b2 spinbutton: increase/decrease value on upwards/downwards touch swipes
This is somewhat analogous to scroll events on pointer devices, the
greater the velocity, the faster the spinbutton spins.
2014-05-23 19:54:26 +02:00
Cosimo Cecchi
1627c903d8 spinbutton: remove unused code 2014-05-09 11:02:45 -07:00
Cosimo Cecchi
5a16ec366d spinbutton: remove unused code 2014-05-09 11:02:41 -07:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
c779b42476 Docs: use // for comments in examples
Without sgml mode, we can't escape /* as /* anymore,
so just switch to // for comments in examples.
2014-02-14 23:34:22 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00
William Jon McCann
63e887e165 docs: replace all <examples> with markdown headings 2014-02-04 16:58:54 -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
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
Matthias Clasen
2f1fa7cdc3 Drop some unnecessary includes
Drop includes of deprecated headers where they are
no longer needed.
2013-07-19 22:32:23 -04:00
Matthias Clasen
0aa57d26b5 Move wholly deprecated classes to gtk/deprecated/
We've recently a number of classes wholly. For these cases,
move the headers and sources to gtk/deprecated/ and adjust
Makefiles and includes accordingly.

Affected classes:
GtkAction
GtkActionGroup
GtkActivatable
GtkIconFactory
GtkImageMenuItem
GtkRadioAction
GtkRecentAction
GtkStock
GtkToggleAction
GtkUIManager
2013-07-19 21:39:47 -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
Alexander Larsson
41a6780f22 spinbutton: set the window on the icon helper 2013-07-03 14:39:26 +02:00
Owen W. Taylor
0032b2dc5a GtkSpinButton: don't constantly recreate style contexts for buttons
Cache the style contexts for the up and down panels, instead of recreating
them each time they are drawn or size requested. GtkSpinButtons were
many times slower to draw than other widgets because of the constant
style matching.

https://bugzilla.gnome.org/show_bug.cgi?id=698682
2013-04-23 14:04:39 -04:00
Alexander Larsson
433c0c2134 GtkSpinButton: Support baseline alignment 2013-04-23 05:58:07 +02:00
Matthias Clasen
1ddfc3a985 Fix the build
This was broken in commit 5bbbc47a4c
2013-03-08 06:26:34 -05:00
Aleksander Morgado
5bbbc47a4c spinbutton: don't override initial text in non-numeric-only spin buttons
https://bugzilla.gnome.org/show_bug.cgi?id=695312
2013-03-08 11:23:11 +01:00
Will Thompson
507bf6e5cf docs: correct various spelling and grammar errors
I noticed a few cases of "wether", and while fixing them noticed a few
"its" which should be "it's". It all went downhill from there.
2013-03-04 22:48:22 +00: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
Cosimo Cecchi
2d5fa78528 spinbutton: fix style context path for internal buttons
We were adding one child too much to the style context path when
generating it for the internal buttons, which in turn caused sibling
selectors from the theme such as :first-child to apply to both buttons
under certain circumstances. Spotted by Lapo Calamandrei.
2012-09-19 15:41:19 -04:00
Cosimo Cecchi
d05191a010 entry: fix requisition width/height to use the current pango layout
This way, we can ensure that width/height changes due to the use of
gtk_entry_set_attributes() are correctly reflected in the size request.

https://bugzilla.gnome.org/show_bug.cgi?id=683168
2012-09-03 11:45:51 -04:00
Paolo Borelli
afd99d3579 Make spinbutton orientable
https://bugzilla.gnome.org/show_bug.cgi?id=683168
2012-09-03 11:45:51 -04:00
Cosimo Cecchi
1cbd84633d spinbutton: fix a typo
GTK_STATE_* -> GTK_STATE_FLAG_*
2012-06-12 09:37:17 -04:00
Cosimo Cecchi
5538552ebc spinbutton: port to GtkIconHelper
Instead of doing our own lookup for symbolic icons and rendering the
pixbuf, use GtkIconHelper as other widgets do, which saves a bunch of
code.

https://bugzilla.gnome.org/show_bug.cgi?id=674807
2012-04-26 13:35:54 -04:00
Benjamin Otte
33f111a47c widget: Don't cache widget paths all the time
Add an internal API that allows GtkStyleContext to create a widget path
for the widget and with that bypassing gtk_widget_get_path() and that
  function caching the path.
2012-04-17 08:59:21 +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
Benjamin Otte
2353d60b8a types: Move GtkAdustment declaration to gtktypes.h
... and make all the headers to not include gtkadjustment.h anymore. Of
course, also include it in the source files instead.
2012-03-03 19:45:03 +01:00
Carlos Garnacho
939ed582ec spinbutton: Set GDK_SCROLL_MASK explicitly
selecting for button press/release doesn't suffice anymore to
get scroll events.
2012-03-01 16:29:00 -05:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Javier Jardón
44135ba2eb gtkspinbutton: Fix compilation warning 2012-01-31 20:46:13 +00:00
Cosimo Cecchi
d140411698 entry: don't consider inner-border for allocation and layout
We want to deprecate the inner-border property and use the standard CSS
border/padding properties. Start with replacing its uses in GtkEntry.
2012-01-31 10:04:26 -05:00
Cosimo Cecchi
8275a20026 entry: change _gtk_entry_get_borders() to return a GtkBorder 2012-01-31 10:04:25 -05:00
Carlos Garcia Campos
f84ec775d8 gtkspinbutton: Use symbolic names for button numbers 2012-01-27 09:47:44 +01:00
Matthias Clasen
64f3347cd7 Fall back to the builtin icons for spinbutton +/-
We do have list-add/-remove icons in the builtin icon theme,
so why not use them ?
2012-01-09 17:15:17 -05:00
Benjamin Otte
0e48cc6dae spinbutton: Pass the right size
We need a better diffrentiation between icon sizes - ie GtkIconSize vs
pixel size. Or more CSS.
2012-01-09 18:37:58 +01:00
Rui Matos
e9549a7514 spinbutton: Use the widget state flags as a base for drawing 2012-01-09 16:45:43 +00:00
Zeeshan Ali (Khattak)
1996618569 gtkspinbutton: Don't hilight buttons when !editable
Don't hilight the buttons on mouse over when 'editable' property is set to
'FALSE.

https://bugzilla.gnome.org/show_bug.cgi?id=667229
2012-01-06 18:35:37 +02:00
Zeeshan Ali (Khattak)
43e29f7cbf gtkspinbutton: Ignore keynav when !editable
Don't allow changing of value through keyboard when 'editable' property is
set to 'FALSE.

https://bugzilla.gnome.org/show_bug.cgi?id=667229
2012-01-06 05:45:46 +02:00
Zeeshan Ali (Khattak)
3caa370bb5 gtkspinbutton: Respect value of inherited 'editable' property
When this property is set to 'FALSE', user's click on the buttons
should not actually update the value but rather result in error bell.

https://bugzilla.gnome.org/show_bug.cgi?id=667229
2012-01-04 00:49:35 +02:00
Chun-wei Fan
1a122a4367 gtk/gtkspinbutton.c: Remove lingering ';'
...so that C89 compilers will not complain
2011-12-30 17:25:47 +08:00
Cosimo Cecchi
10cfa90817 spinbutton: redesign to use an horizontal layout
Rewrite GtkSpinButton to use a touchscreen friendly horizontal layout.
Other features include:
- support for theming buttons with nth-child
- full support for RTL
- use + and - symbolic icons instead of arrows
- general streamlining and cleanup of a lot of related code

https://bugzilla.gnome.org/show_bug.cgi?id=663359
2011-11-28 09:40:23 -05:00
Alexander Larsson
68c74e1427 Set top/bottom style classes on spinbutton buttons 2011-11-17 19:43:13 +01:00
Stef Walter
5b6f0b9893 GtkSpinButton: Clarify clamping behavior in gtk_spin_button_set_range doc
* If the current value is outside the range, it will be adjusted
   to fit within the range, otherwise it will remain unchanged.

https://bugzilla.gnome.org/show_bug.cgi?id=664021
2011-11-15 07:47:35 +01:00
Michael Natterer
5c4f2ef0c1 gtk: move _gtk_modules_has_mixed_deps() to gtkmodlesprivate.h
and remove gtkmainprivate.h completely.
2011-10-23 13:57:07 +02:00
Matthias Clasen
d324a99454 Fix entry drawing in the presence of margins
Margins need to be taken into account when comparing requisitions
and allocations, which GtkEntry (and subclasses) do for some reason.
2011-08-09 15:12:21 +02:00
Matthias Clasen
918514d51d First cut at GailEntry -> GtkEntryAccessible
Replace the factory for entry and spin button with
gtk_widget_class_set_accessible_type() calls, and move then
to the GtkAccessible namespace.
2011-07-05 16:08:08 -04:00
Cosimo Cecchi
aa515e71d1 spinbutton: don't render an additional background below arrows
It's an entry, so it already has a background below, even when the entry
doesn't have a frame. Also, gtk_spin_button_draw_arrow() will render a
background and a frame in the arrow space anyway.
2011-06-09 15:06:19 -04:00
Cosimo Cecchi
4d8b5baf7e spinbutton: don't remove the entry style class while rendering arrows 2011-06-09 15:06:18 -04:00
Matthias Clasen
1f4dd57328 GtkSpinButtonPrivate: Improve struct packing 2011-04-12 12:45:28 -04:00
Xan Lopez
eeedcf3612 spinbutton: remove unused variable 2011-03-04 21:43:08 +01:00
Cosimo Cecchi
6a423a99ad spinbutton: rework GtkSpinButton drawing handler
Make the arrows bigger, and position them according to the mockups.
2011-03-04 11:13:14 -05:00
Cosimo Cecchi
cae7b93729 Revert "spinbutton: center-align by default"
This reverts commit 64ef11985b.
2011-03-04 11:13:13 -05:00
Cosimo Cecchi
64ef11985b spinbutton: center-align by default 2011-03-03 17:48:25 -05:00
Michael Natterer
68d176d80b gtk: don't always invalidate spinbuttons on each leave_notify()
but only when an arrow was prelighted. Also, chain up unconditonally
in enter_notify() and leave_notify() because GtkEntry implements them
too.
2011-02-16 18:42:18 +01:00
Michael Natterer
c1bc521e92 gtk: get rid of two cases of invalidating the spinbutton when not needed 2011-02-06 11:17:58 +01:00
Michael Natterer
5d3106275a gtk: no need to add GTK_STYLE_FLAG_FOCUSED to the widget's state flags
because they correctly contain that flag now if the widget has focus.
2011-01-21 15:38:52 +01:00
Michael Natterer
7fabfec533 gtk: save/restore the cairo_t around early upchaining in draw()
and don't save/restore the style context because that's the job of
each draw() implementation.
2011-01-21 15:06:43 +01:00
Pavel Holejsovsky
2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Carlos Garnacho
62fd79b224 Do not set junction sides to the entry frame in spinbuttons.
That's meant to be the outer frame, so no junction sides apply there
2011-01-17 04:43:52 +01:00
Benjamin Otte
76b50a7eae spinbutton: Update adjustment usage for sealing
Also rename all variables named "adj" to "adjustment", like they're
called everywhere else.
2011-01-05 23:50:21 +01:00
Matthias Clasen
b123bc41fd Move docs for gtkmain inline
At the same time, introduce a gtkmainprivate.h header
and various other cleanups.

Based on a patch by Tadej Borovšak.
https://bugzilla.gnome.org/show_bug.cgi?id=617471
2011-01-04 17:32:12 -05: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
72b69ae2ed Don't use page_size in GtkSpinButton
It ought to be 0 anyway, but don't use it.

This puts bug 307963 to rest.
2011-01-03 21:51:58 -05:00
Matthias Clasen
85fe6cb2c4 Move GtkSpinButton docs inline
...and modernize the examples at the same time.

This fixes a problem pointed out in bug 638193.
2011-01-02 23:30:02 -05:00
Carlos Garnacho
0f0512aee3 Use gtk_style_context_get_font() in GtkSpinButton 2010-12-24 20:20:40 +01:00
Carlos Garnacho
760d6d1e78 Do not set "entry" class in spinbutton buttons.
Also, fix an unpaired gtk_style_context_save() call.
2010-12-24 19:37:56 +01:00
Carlos Garnacho
89e6cad92f GtkSpinButton: Use GtkStyleContext 2010-12-13 22:31:29 +01:00
Michael Natterer
c2fd7e8350 gtk: draw the frame around the spinbutton's buttons conditionally
(depending on GtkEntry::has-frame)
2010-11-19 14:55:47 +01:00
Michael Natterer
476b4c248c gtk: fix automatic width of spin buttons which have no width in chars set 2010-10-31 20:03:55 +01:00
Matthias Clasen
ac1bb229d1 Remove size_request from GtkSpinButton 2010-10-26 23:46:06 -04:00
Javier Jardón
0b72acf78d gtkspinbutton: Use accessor functions to access GtkEntry 2010-10-26 06:07:42 +02:00
Matthias Clasen
596da84312 Make GtkEntry a no-window widget
Use input-only windows for capturing input, and just draw onto
the parent window. This allows themes to make entries with rounded
corners. Patch by Boram Park.

https://bugzilla.gnome.org/show_bug.cgi?id=632736
2010-10-21 13:17:33 +02:00
Matthias Clasen
331323e5c7 Make GtkSpinButton a no-window widget
We still retain an input-only window here for now, but all
the painting is done to the parent window.
2010-10-21 11:41:20 +02:00
Javier Jardón
b072ea220c Remove unneded casts
As gtk_adjustment_new() returns a GtkAdjustment* now

https://bugzilla.gnome.org/show_bug.cgi?id=630731
2010-09-29 01:18:10 +02:00
Javier Jardón
42f480a537 gtk_adjustment_new() should return a GtkAdjustment*
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=630731
2010-09-29 01:18:10 +02:00
Javier Jardón
eac1959d2c Move destroy signal to GtkWidget
Also make GtkWidget derive from GInitiallyUnowned
2010-09-26 22:18:18 -04:00
Javier Jardón
3b8184cfee Move classes that currently derive from GtkObject to GInitiallyUnowned 2010-09-26 22:18:13 -04:00
Benjamin Otte
bc3d3e6cf4 spinbutton: 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
f0c067063c spinbutton: 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
5228913f68 spinbutton: Port to draw vfunc 2010-09-26 15:11:35 +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
Matthias Clasen
e0aa12eb0a Tons of transfer annotations 2010-09-21 00:18:11 -04:00
Javier Jardón
efbf04236e Change GtkEditable typedef from GtkEditableClass to GtkEditabeInterface
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=323904
2010-09-17 19:57:09 +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
29044f0f0e gtk/gtkspinbutton.c: use accessor functions to access GtkWidget 2010-09-08 21:13:03 +02:00
Tristan Van Berkom
9934007420 Completely removed requisition cache from GtkWidget instance structure.
Since we have a new mechanism for requesting sizes: GtkSizeRequestIface;
it makes no sense to maintain this cache on the GtkWidget structure...
removing the requisition cache however does not break the old "size-request"
signal which is there for backwards compatability reasons.

In any case widget->requisition should not have been accessed,
gtk_widget_get_child_requisition() would have been the correct way
to consult the cache.

This commit also deprecates the newly added gtk_widget_get_requisition()
API and makes it fallback on gtk_size_request_get_size().
2010-09-08 18:50:24 +02:00
Matthias Clasen
ece148eec0 Remove ::state-hint use
This use of the property was overlooked when it was removed.
We now always behave as if state-hint == TRUE.
2010-09-02 08:59:27 -04:00
Javier Jardón
1e5d7c0225 Use GtkFooPrivate instead GtkFooPriv 2010-08-27 04:48:23 +02:00
Philip Withnall
3eb197b51f Bug 596125 — Property string fixes 2010-08-10 09:23:49 +01:00
Javier Jardón
cbbffa18f8 Add _gtk_spin_button_get_panel private function
It's needed in gtktestutils.c
2010-07-13 19:40:50 +02:00
Javier Jardón
57d870ac5b gtkspinbutton: move public members to private structure 2010-07-13 19:40:50 +02:00
Matthias Clasen
bcbb976d91 Respect GtkEntry::state-hint when drawing spinbutton features
As proposed in bug 589904 by Thomas Wood.
2010-07-09 22:23:25 -04: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
Javier Jardón
3c8a54b2f7 Remove GdkWChar deprecated code 2010-06-20 00:22:26 +02:00
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
Javier Jardón
b18b33ae82 Revert "Forward-port a GtkAdjustment compatibility fix"
In the early 2.14.x releases, GtkAdjustment was changed to enforce
that values are restricted to the range [lower, upper - page_size].
This has always been the documented behaviour, and the recommended
practice is to set page_size to 0 when using adjustments for simple
scalar values, like in a slider or spin button.
Due to the large number of applications that are affected by this
change, the behaviour has been reverted to the old behaviour in
2.14.3, with an explicit warning that this change will be
reintroduced in 2.90.

This reverts commit e6373738fc.

https://bugzilla.gnome.org/show_bug.cgi?id=619474
2010-05-24 15:39:30 +02: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
Javier Jardón
16a59ad912 Deprecate widget flag: GTK_WIDGET_REALIZED
Use gtk_widget_get_realized() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-03 20:41:05 +01:00
Javier Jardón
1fe7d3cefd Deprecate widget flag: GTK_WIDGET_MAPPED
Use gtk_widget_get_mapped() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-03 20:19:03 +01:00
Javier Jardón
4232115e22 Deprecate widget flag: GTK_WIDGET_HAS_FOCUS
Use gtk_widget_has_focus() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 06:11:01 +01:00
Javier Jardón
a27d5a2c9e Deprecate widget flag: GTK_WIDGET_IS_SENSITIVE
Use gtk_widget_is_sensitive() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 05:32:51 +01:00
Javier Jardón
4f78f70b15 Deprecate widget flag: GTK_WIDGET_DRAWABLE
Use gtk_widget_is_drawable() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 04:55:55 +01:00
Johan Dahlin
fe85272112 [annotations] Add allow-none
This commit was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API

https://bugzilla.gnome.org/show_bug.cgi?id=610474
2010-02-19 17:57:51 -02:00