Commit Graph

33946 Commits

Author SHA1 Message Date
Alexander Larsson
aeab118289 GtkButton: Baseline align butttons 2013-03-26 10:58:12 +01:00
Alexander Larsson
fc5ba0a6ef GtkImage: Support baselines
This uses the current font metrics to guess the baseline of the image.
Without this any non-centered baseline in buttons with images look weird.
2013-03-26 10:56:53 +01:00
Alexander Larsson
3d92798c96 Fix indicator position for baseline aligned radio/check buttons
Rather than just always centering the indicator we adjust it according
to the metrics of the widget font.
2013-03-26 10:31:13 +01:00
Alexander Larsson
8cb229a847 testbase: Make test nicer 2013-03-25 18:04:19 +01:00
Alexander Larsson
9cfb89990e GtkButtonBox: Support baseline alignment 2013-03-25 17:59:55 +01:00
Alexander Larsson
8b8d6e188d GtkGrid: Modify requested baseline as per baseline_pos
If non-baseline-aligned items in the row make the height higher,
use baseline_pos to figure out where to request the baseline.
2013-03-25 17:58:29 +01:00
Alexander Larsson
f7863d7fa5 GtkBox: Modify requested baseline as per baseline_pos
If non-baseline-aligned items in the box make the height higher,
use baseline_pos to figure out where to request the baseline.
2013-03-25 17:57:07 +01:00
Alexander Larsson
7918b3d1a3 Add gtk_widget_get_preferred_size_and_baseline
This is needed by baseline & h4w/w4h aware containers.
2013-03-25 17:55:59 +01:00
Alexander Larsson
601b5f4f52 testbaseline: Test toggle, radio and checkbuttons 2013-03-22 13:19:27 +01:00
Alexander Larsson
89ef97cd25 GtkCheckButton: Implement baseline alignment 2013-03-22 13:19:27 +01:00
Alexander Larsson
8f17db9b4a GtkButton: Fix y displacement with baseline alignment
We need to shift down the baseline too when displacing y.
2013-03-22 13:19:27 +01:00
Alexander Larsson
dcacd41641 testbaseline: Test spinbuttons 2013-03-22 13:19:27 +01:00
Alexander Larsson
6b3f27c76c GtkSpinButton: Support baseline alignment 2013-03-22 13:19:27 +01:00
Alexander Larsson
faf2d7aab7 GtkSizeRequestCache: Don't store baselines in horizontal case
This saves memory for every widget (maximum 48 bytes per widget) at
a cost of a few duplicated codepaths in the size request cache.
2013-03-22 13:19:26 +01:00
Alexander Larsson
2725f74d92 testbaseline: Add more tests 2013-03-21 23:43:08 +01:00
Alexander Larsson
498bb2046a GtkGrid: Add baseline alignment of grid itself
You can now set which row is the baseline for the grid itself, and
if that row has a baseline and the grid itself is GTK_ALIGN_BASELINE
then the grid will be vertically baseline aligned.
2013-03-21 23:43:08 +01:00
Alexander Larsson
c7c2767d76 GtkGrid: Add gtk_grid_set/get_row_baseline_position 2013-03-21 23:43:07 +01:00
Alexander Larsson
e3345e74c5 GtkWidget: Redraw widget when baseline changes
The baseline affects how widget is drawn, so we need to repaint it
when the baseline changes
2013-03-21 23:43:07 +01:00
Alexander Larsson
361ff36120 Add GTK_DEBUG=baselines support
This draws red lines to show where the baselines are
2013-03-21 23:43:07 +01:00
Alexander Larsson
37c9c5e49e testbaseline: Test GtkGrid 2013-03-21 11:10:09 +01:00
Alexander Larsson
d0ab7336ba GtkGrid: Support baseline alignment in grid rows 2013-03-21 11:09:43 +01:00
Alexander Larsson
639f1407c9 testbaseline: Add entries 2013-03-20 14:30:57 +01:00
Alexander Larsson
62952efc04 GtkEntry: Support baselines 2013-03-20 14:30:41 +01:00
Alexander Larsson
21c2e6da9a Add tests/testbaseline 2013-03-20 14:06:41 +01:00
Alexander Larsson
3e2606f4f4 GtkButton: Add baseline align support 2013-03-20 14:06:41 +01:00
Alexander Larsson
ac7dcd90cc GtkAlignment: Support baselines
We now report any baselines from the child, and allocate it.
Also, in the case of a baselign aligned child we ignore yscale/yalign
as that is not supportable.
2013-03-20 14:06:41 +01:00
Alexander Larsson
e6b12e0fd7 GtkBox: Add baseline alignment for horizontal boxes
Report a baseline based height and baseline whenever there
are children with ALIGN_BASELINE.

Assign baseline to childen in size_allocate. Either the one inherited
from the parent if set, or otherwise calculate one based on any
ALIGN_BASELINE children.
2013-03-20 14:06:41 +01:00
Alexander Larsson
f76e22b39e GtkLabel: Support baseline
Report the baseline in get_preferred_height_and_baseline_for_width().
2013-03-20 14:06:41 +01:00
Alexander Larsson
7a568a6127 Initial support for baselines
This modifies the size machinery in order to allow baseline support.

We add a new widget vfunc get_preferred_height_and_baseline_for_width which
queries the normal height_for_width (or non-for-width if width is -1) and
additionally returns optional (-1 means "no baseline") baselines for the minimal
and natural heights.

We also add a new gtk_widget_size_allocate_with_baseline() which baseline-aware
containers can use to allocate children with a specific baseline, either one inherited
from the parent, or one introduced due to requested baseline alignment in the
container itself. size_allocate_with_baseline() works just like a normal size
allocation, except the baseline gets recorded so that the child can access it
via gtk_widget_get_allocated_baseline() when it aligns itself.

There are also adjust_baseline_request/allocation similar to the allocation
adjustment, and we extend the size request cache to also store the baselines.
2013-03-20 14:06:41 +01:00
Alexander Larsson
df6dcfb511 Add GTK_ALIGN_BASELINE to GtkAlign
Setting this means baseline aware containers should align the widget
according to the baseline. For other containers this behaves like
FILL.

In order to not suprise old code with a new enum value we always
return _FILL for _BASELINE unless you specifically request it via
gtk_widget_get_valign_with_baseline().
2013-03-20 14:06:41 +01:00
Alexander Larsson
76e466197a GtkWidget: Handle style updates before realize
If the style changes before we're realized we will delay the
style-updated signal until realize. However, we then lose
the changes bitmap. This means that gtk_widget_real_style_updated()
must treat a NULL change as "everything changed" and queue a resize.
2013-03-20 13:56:16 +01:00
Chun-wei Fan
b20fde048f Update Visual Studio Proprerty Sheets
Stop installing the gtk3-demo data files as they are now built into the
gtk3-demo program using GResources.
2013-03-20 19:08:19 +08:00
Chun-wei Fan
9103dbb81d Fix introspection building for Visual Studio builds
Apparently time_t is used in gtkrecentmanager.h, which is a special type
that could not be recognized when Gtk-3.0.gir is built.  Judging from the
ast.py from the gobject-introspection package, we can define time_t as
long, and this will allow pygobject to load the Gtk module from
gi.repository.
2013-03-20 17:42:15 +08:00
Nilamdyuti Goswami
4b2243c8af Assamese translation updated 2013-03-20 13:22:00 +05:30
Arash Mousavi
1d5afb8613 L10N: Updated Persian Translation 2013-03-20 10:13:17 +03:30
Matthias Clasen
33d409d9fd Add an example for subtitles in header bars 2013-03-19 22:08:13 -04:00
Matthias Clasen
3731a2bd90 GtkHeaderBar: Add subtitle support
As seen in GdHeaderBar.
2013-03-19 22:07:26 -04:00
Matthias Clasen
d42c2c3f19 GtkHeaderBar: Survive toggling custom / non-custom titles
The code was always adding a label widget as a child, but
then skipping over it in forall if a custom_title was present.
This confuses internal logic of GTK+ which assumes that it
can iterate over the entire widget hierarchy with forall,
to maintain state. Fix this by destroying the label when
a custom_title is set, and recreating it as needed.
2013-03-19 20:52:54 -04:00
Matthias Clasen
2648ba45c6 test custom titles more thoroughly
This adds a way to toggle between custom and non-custom titles
in testheaderbar, which is currently broken.
2013-03-19 20:51:43 -04:00
Matthias Clasen
3289b3efbf GtkHeaderBar: Don't leak
Should have a finalize function, if there's strings to free.
Also avoid some pointless extra ref on custom title widgets.
2013-03-19 20:35:28 -04:00
Gil Forcada
2f9726b4a4 [l10n] Updated Catalan translation 2013-03-19 23:16:04 +01:00
Rob Bradford
1b15b9e1bc wayland: Preserve dimensions separately for fullscreen / maximised case
Use separate fields for saving the window dimensions prior to fullscreening
and maximisation. Then use those fields to restore the window dimensions from.
2013-03-19 19:52:49 +00:00
Rob Bradford
8cdbee7fd2 window: Use update_window_buttons to hide title on fullscreen
The function update_window_buttons shows or hides the title header after it
has finished updating the visibility of the various buttons. Unfortunately
this
conflicted with the hiding of the title done when going fullscreen.

This solves the problem and fixes the rendering of fullscreen applications by
using update_window_buttons to control the visibility of the box in the
fullscreen case.
2013-03-19 19:48:35 +00:00
Scott Moreau
1be7f3dee9 wayland: Implement gdk_window_[un]maximize
This allows the buttons in the decorations to maximise the window.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=695945

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-03-18 15:51:39 +00:00
Alexander Larsson
8fb60cda19 broadway: Fix assert failure
Requests are not limited in size by BroadwayRequest, as
BroadwayRequestTranslation can be of variable size. No need
to copy the request anymore though, because requests are aligned
now.
2013-03-18 16:41:05 +01:00
Alexander Larsson
99cc5758b1 broadway: Ensure broadway request members are 32bit aligned 2013-03-18 16:41:02 +01:00
Christian Persch
953253f685 gtk: gtk_init_with_args allows NULL for parameter_string 2013-03-18 14:12:12 +01:00
Matthias Clasen
c4dc3a779a Revert "GtkHeaderBar: Allow window dragging"
This reverts commit 30a1a79322.

This turns out to be unnecessary when you can set the titlebar
on the window and let GtkWindow handle the events. As a benefit,
we get the window menu on custom titlebars for free.
2013-03-18 08:50:23 -04:00
Matthias Clasen
55969a8a0c Use gtk_window_set_titlebar in testheaderbar
This demonstrates how custom titlebars work both with
and without csd.
2013-03-18 08:50:22 -04:00
Matthias Clasen
30d0542309 Add documentation for gtk_window_set_titlebar 2013-03-18 08:50:22 -04:00