Commit Graph

26207 Commits

Author SHA1 Message Date
Benjamin Otte
a380533336 container: Remove check
The check is not working for many containers anymore as they are not the
direct parents of their children. We want to allow this behavior in more
places.
2016-03-02 13:54:39 +01:00
Benjamin Otte
c3d3bf61e4 combobox: Put the button in a box
This is so we can put the entry into the box in the next commit.
2016-03-02 13:54:39 +01:00
Benjamin Otte
04d9577cb7 combobox: Make sure the cellview expands
Windows theme needs the expansion for correct drawing of the focus
outline.
2016-03-02 13:54:39 +01:00
Benjamin Otte
13b320ecb2 combobox: Ensure an entry gets created for has_entry combos
Previously add/remove on the combobox would result in a cellview being
created.
2016-03-02 13:54:39 +01:00
Matthias Clasen
956b2ff998 progressbar: Don't leave css nodes behind
We create and destroy gadgets inside the hierarchy here,
and if we don't explicitly remove their CSS nodes from the parent,
they stick around.
2016-03-01 16:00:54 -05:00
Matthias Clasen
577783a19d scale: Don't leave css nodes behind
We create and destroy gadgets inside the scale hierarchy here,
and if we don't explicitly remove their CSS nodes from the parent,
they stick around.
2016-03-01 15:58:21 -05:00
Cosimo Cecchi
5889d2520f Adwaita: fix outline for scale trough 2016-03-01 12:54:01 -08:00
Matthias Clasen
cb614cc838 range: Don't leave css nodes behind
We create and destroy gadgets inside the range hierarchy here,
and if we don't explicitly remove their CSS nodes from the parent,
they stick around.
2016-03-01 15:48:01 -05:00
Matthias Clasen
37007c47a5 level bar: Don't leave css nodes behind
We create and destroy gadgets inside the levelbar hierarchy here,
and if we don't explicitly remove their CSS nodes from the parent,
they stick around.
2016-03-01 15:35:32 -05:00
Matthias Clasen
87e71afd50 cell renderer: Strip out :drop(active) state
It does not make sense to render every cell in a treeview as
drop target, even when the treeview itself is set as a drop destination.

https://bugzilla.gnome.org/show_bug.cgi?id=761686
2016-03-01 15:18:34 -05:00
Matthias Clasen
eff97fd55f Take a reference on the im context for async ops
This might fix the crash in yelp that some people continue
to see.

https://bugzilla.gnome.org/show_bug.cgi?id=762887
2016-03-01 07:59:15 -05:00
Benjamin Otte
61f5562f9f notebook: Tell everyone we reordered stuff
Fixes keybindings for reordering actually emitting signals and properly
updating CSS/the screen.
2016-02-29 23:17:00 +01:00
Benjamin Otte
a74bb0dec4 notebook: Reallocate tab gadgets when we reorder them
Otherwise they stay in their position and don't cause a redraw. Which
really confuses Epiphany users apparently.

https://bugzilla.gnome.org/show_bug.cgi?id=762720
2016-02-29 22:00:03 +01:00
Cosimo Cecchi
d000b212c6 range: fix fill level for vertical inverted scales 2016-02-29 12:53:08 -08:00
Cosimo Cecchi
5a83787dc0 Update CSS nodes documentation 2016-02-29 10:45:14 -08:00
Cosimo Cecchi
bb55a1a958 scale: add gadgets for indicator/label in scale marks
This will allow us to theme them indepdendently, and specify a size for
the indicator from the theme.
2016-02-29 10:45:14 -08:00
Cosimo Cecchi
7bd3d87eeb scale: add a gadget for every mark
We want to add another gadget for the mark indicator. This will allow us
to do so.
2016-02-29 10:45:14 -08:00
Cosimo Cecchi
74a8bbfd38 Adwaita: add minimum size for marks
It's still suboptimal, because there's no way to control the size of the
indicator alone, but this does the job for now.
2016-02-29 10:45:14 -08:00
Cosimo Cecchi
0fb50dc9a8 gadget: improve debug message 2016-02-29 10:45:14 -08:00
Cosimo Cecchi
0c8dbf07ce range: draw slider on top of all contents
This is so that e.g. the focus ring is drawn under the slider.
2016-02-29 10:45:14 -08:00
Cosimo Cecchi
cdd7a7bdcd scale: implement rendering for marks gadgets
This completes the conversion of scale marks to gadgets.
2016-02-29 10:45:14 -08:00
Cosimo Cecchi
1a8eb9fefa scale: implement size allocate for mark gadgets
This allows to move the mark sections around with e.g. margins.
2016-02-29 10:45:14 -08:00
Cosimo Cecchi
562a501f3b scale: port marks size request to gadgets 2016-02-29 10:45:14 -08:00
Cosimo Cecchi
2f420d0e14 scale: use gadgets instead of nodes for mark containers
The gadget is not yet allocated though.
2016-02-29 10:45:14 -08:00
Cosimo Cecchi
b73d274d55 scale: rename function arguments
To make them clearer. No functional change here.
2016-02-29 10:45:14 -08:00
Cosimo Cecchi
8d5d16ae56 scale: remove unused argument
It's always GTK_POS_TOP.
2016-02-29 10:45:13 -08:00
Cosimo Cecchi
bc41ff8af4 range: better hack for GtkColorScale
Just draw the slider, since that is the only thing GtkColorScale cares
about.
2016-02-29 10:45:13 -08:00
Cosimo Cecchi
887b6d65a1 range: deprecate gtk_range_get/set_min_slider_size()
Nothing uses these functions inside GTK anymore.
2016-02-29 10:45:13 -08:00
Cosimo Cecchi
424f17c0fb range: don't use gtk_range_set_min_slider_size()
The way this method is used from the GtkRange subclasses doesn't really
work well when the slider properties change as a consequence of e.g. a
style class being applied (e.g. the fine-tune style class).

In fact, there's no need to read the minimum slider size out of band,
and we can obtain the same result in a way that always work by setting a
private property on GtkRange.
2016-02-29 10:45:13 -08:00
Lapo Calamandrei
0468ff1545 Adwaita: some more WIP theme work for the new scale 2016-02-29 10:45:13 -08:00
Cosimo Cecchi
3ff66edb6b gadget: simplify code 2016-02-29 10:45:13 -08:00
Cosimo Cecchi
0883ff5eed range: use border box for slider area
Since we can use negative margins, we should not use the margin box
for the slider area. Use the border box instead, since that's what is
typically mapped to the visible area.
2016-02-29 10:45:13 -08:00
Cosimo Cecchi
6ecab5ee6b range: use new GtkCssGadget API instead of rolling our own 2016-02-29 10:45:13 -08:00
Cosimo Cecchi
44178c0541 gadget: add API to get various area boxes
Compared to the function returning the allocation, these will return the
box in gadget coordinates.
2016-02-29 10:45:13 -08:00
Cosimo Cecchi
2d2a81682d range: simplify code
Instead of directly accessing the widget allocation, we can use the
gadget API to test whether the coordinates are in the main gadget.
2016-02-29 10:45:13 -08:00
Lapo Calamandrei
622f5aef4e Adwaita: WIP for new range theme 2016-02-29 10:45:13 -08:00
Cosimo Cecchi
d1433c25f3 range: add a gadget for the whole widget area
This commit introduces another node, called "contents", that holds the
main contents of the range. This allows for the main gadget itself to
span across the whole surface of the widget now.
2016-02-29 10:45:13 -08:00
Cosimo Cecchi
a9ea544f3d scale: always add marks at the beginning or the end
Marks are always either the first or the last child of the scale.
2016-02-29 10:45:13 -08:00
Cosimo Cecchi
1d047f0097 range: use new GtkBoxGadget API instead of counting children 2016-02-29 10:45:13 -08:00
Cosimo Cecchi
6370d6cb27 boxgadget: add APIs to insert gadgets next to siblings 2016-02-29 10:45:13 -08:00
Cosimo Cecchi
6401e2405e range: use new GtkBoxGadget API instead of removing/inserting 2016-02-29 10:45:13 -08:00
Cosimo Cecchi
06776d3d2f boxgadget: add API to set expand/align flags for gadget child 2016-02-29 10:45:13 -08:00
Cosimo Cecchi
6827bd5e04 range: move slider drawing where it belongs
The slider gadget is a child of the trough gadget, so draw it from
there.
2016-02-29 10:45:12 -08:00
Cosimo Cecchi
f0d9afd300 scrollbar: deprecate min-slider-length style property
In favor of min-height/min-width, like we did for other similar
properties.
2016-02-29 10:45:12 -08:00
Cosimo Cecchi
0974b0d843 range: whitespace fix 2016-02-29 10:45:12 -08:00
Cosimo Cecchi
fb11cc1baf range: remove border allocation hack
We can achieve the same result with a negative margin.
2016-02-29 10:45:12 -08:00
Cosimo Cecchi
1a116b9a95 colorscale: don't use style properties to determine slider size 2016-02-29 10:45:12 -08:00
Cosimo Cecchi
8b87eca11e Revert "range: move GtkColorScale special case to GtkColorScale"
This reverts commit d93d266ed9e3e26e382a4f6d4b5d4ea19eff3bcf.
2016-02-29 10:45:12 -08:00
Cosimo Cecchi
b927fc0874 Revert "range: simplify code"
This reverts commit a74f7dcaf8a02c96c6bfecab6969e1d33ecb9332.
2016-02-29 10:45:12 -08:00
Cosimo Cecchi
a7099d1468 range: simplify code
Now that everything is in the main gadget, we can just let it propagate
drawing to its children.
2016-02-29 10:45:12 -08:00
Cosimo Cecchi
b6f0b6be87 range: move GtkColorScale special case to GtkColorScale
Now we can just tweak the node visibility for it.
2016-02-29 10:45:12 -08:00
Cosimo Cecchi
cbbe237c18 range: remove special case that's not needed
We already set the gadget not to be visible in that case.
2016-02-29 10:45:12 -08:00
Cosimo Cecchi
ddb863e523 range: move slider inside the trough
This will require a rewrite of most of the theme, but it's the right
thing to do.
2016-02-29 10:45:12 -08:00
Cosimo Cecchi
d1c5ecfaef scale: deprecate slider-length style property
This can be achieved using min-height/min-width CSS properties now.
2016-02-29 10:45:12 -08:00
Cosimo Cecchi
c1eff2cce5 range: deprecate more style properties
These are never read now.
2016-02-29 10:45:12 -08:00
Cosimo Cecchi
413b9d5b3c range: continue porting to GtkGadgets
This commit rewrites a lot of the GtkRange internals to make full use
of the gadget structure.
2016-02-29 10:45:12 -08:00
Cosimo Cecchi
e9fe46ea5f gadget: add hit test functions
These will be useful in later commits.
2016-02-29 10:45:12 -08:00
Cosimo Cecchi
8c43b3ee60 range: remove unused code 2016-02-29 10:45:12 -08:00
Cosimo Cecchi
6c19947859 range: remove call that is not needed
gtk_range_calc_slider() already calls the same function when needed.
2016-02-29 10:45:12 -08:00
Cosimo Cecchi
83a6471c4e range: simplify code a bit 2016-02-29 10:45:11 -08:00
Cosimo Cecchi
d19215015e range: don't call gtk_range_calc_layout() in realize()
This should not be needed, and we want to get rid of
gtk_range_calc_layout().
2016-02-29 10:45:11 -08:00
Cosimo Cecchi
1f9de3cfec range: deprecate arrow-scaling style property
This can be done with CSS now.
2016-02-29 10:45:11 -08:00
Cosimo Cecchi
3b37f2a42a range: use newer GtkCssGadget API 2016-02-29 10:45:11 -08:00
Cosimo Cecchi
d0c671ddfe range: deprecate trough-under-steppers
It's not clear what this would do in a CSS world, and all the themes set
it to TRUE anyway...
2016-02-29 10:45:11 -08:00
Cosimo Cecchi
4bb0a8db47 range: first pass at porting to gadgets
There's still a lot to be done, but this is functional and we'll improve
the loose ends in the next commits.
2016-02-29 10:45:11 -08:00
Timm Bäder
41119057dd frame: Fix horizontal size request
We were adding the border gadget size and the label widget size in any
case, but when calculating the width, we want the maximum of those two,
not the sum.

https://bugzilla.gnome.org/show_bug.cgi?id=760482
2016-02-29 14:19:38 +01:00
Matthias Clasen
2ee7fb1818 Don't use g_print for debug output
The g_print documentation explicitly says not to do this, since
g_print is meant to be redirected by applications. Instead use
g_message for logging that can be triggered via GTK_DEBUG.
2016-02-28 21:40:23 -05:00
Matthias Clasen
0ac71e81cf Drop some unused debug printfs
Remove some debug spew that has been ifdef'ed out for years
and does not look useful enough to keep.
2016-02-28 21:40:23 -05:00
Cosimo Cecchi
8e1368e6de widget: make sure to check all children for allocation needs
GtkWidget uses gtk_container_foreach() to iterate over children and
check whether they need their allocation reset.
However, that leaves out internal children, such as scrollbars of a
GtkScrolledWindow. Use gtk_container_forall() instead.
2016-02-28 12:30:16 -08:00
Matthias Clasen
bbd94b5a9f gtk: Strip newlines from g_warning and g_error
g_logv adds one for us already.
2016-02-28 12:23:12 -05:00
Timm Bäder
870a5b424f frame: Don't move border gadget and child down
Setting label-yalign should affect the border gadget, but we need to
compensate for its position by moving the child down or up, depending on
the border gadget's position, so the child never moves.

https://bugzilla.gnome.org/show_bug.cgi?id=762123
2016-02-28 09:24:21 -05:00
Matthias Clasen
98a36955fe file chooser: Don't ellipsize "Other Locations"
It just looks wrong if the file chooser comes up with
"Other Locations" ellipsized. Treat it like the other
fixed entries. We only want to ellipsize bookmarks, because
their length is unpredictable.
2016-02-27 23:03:55 -05:00
Benjamin Otte
3463031929 win32 theme: Implement GtkFrame 2016-02-27 17:23:44 +01:00
Benjamin Otte
39bfac0876 win32 theme: Remove special case for notebooks
The special case is coded into Wine, but it makes notebooks
disappear wrong. So remove it.
2016-02-27 17:03:49 +01:00
Benjamin Otte
5d34ee729d win32: Implement fallback code for tabs
This is naive code in that it doesn't do the rounded edges for the
tab items yet. We can fix that later I guess.
2016-02-27 14:34:33 +01:00
Benjamin Otte
b18e64e6c6 win32: Add fallback drawing code for window frames 2016-02-27 14:34:33 +01:00
Benjamin Otte
879333d226 win32: Finish button drawing code
We now draw real Windows 95 buttons.

Also split out a draw_edge() function that is supposed to emulate
Windows' DrawEdge() function. I guess we'll need it in other places,
too.
2016-02-27 14:34:33 +01:00
Benjamin Otte
053e549dbc notebook: Redo notebook implementation
So far, this only reworks the tabs at top implementation.
Windows doesn't have support for theming tabs at left/right/bottom
so we need to figure out what to do there. Wine falls back to
unthemed code.
2016-02-27 05:15:57 +01:00
Benjamin Otte
245d217e06 boxgadget: Add ability to draw children in reverse
This is necessary for GtkNotebook so that the stack is always drawn
before the header.
And that is necessary so that the active tab can use negative
margins to overdraw the border of the stack to create a gap and
simulate old GTK2-style visuals for notebooks.
2016-02-27 03:59:20 +01:00
Benjamin Otte
a2fa647199 cssimagewin32: IMplement printing
Caveat: over() and margins() arent' printed, but they are soon gonna
be removed anyway.
2016-02-27 03:59:20 +01:00
Benjamin Otte
e45cb3340c window: Include decoration border and padding in resize area
This is relevant for the Windows theme, which is the only theme that
uses padding on decorations. All other themes are unaffected.
2016-02-27 03:59:20 +01:00
Benjamin Otte
cdb1cda68b notebook: The active tab is now :checked
:active is reserved for "mouse button down on node", so we have to use
something else. And stack switcher and radio buttons use :checked for
the active widget, so it makes sense to use :checked for the active tab,
too.

Themes have been adapted.

TODO: Implement :active for tabs.
2016-02-27 03:48:46 +01:00
Benjamin Otte
6b4788c3ea textview: Support borders in text node 2016-02-27 03:39:51 +01:00
Benjamin Otte
d7bc0fd24c textview: Fix coordinates when background drawing of text node
Fixes black areas in source view of gtk-demo.
2016-02-27 03:27:39 +01:00
Matthias Clasen
ca3d87ce70 Avoid an out-of-bounds access
When the offset gets smaller than min_offset, we can't
access the array at that position.
2016-02-26 15:52:19 -05:00
Matthias Clasen
88e372cd09 infobar: Avoid a memory leak in an error case
Parsing <action-widgets> could sometimes fail to free
some of the data, if a nonexisting widget is referenced.
Found by gcc's leak sanitizer.
2016-02-26 15:52:19 -05:00
Matthias Clasen
c784d5d700 levelbar: Avoid a use-after-free
We were freeing the old offset before using its name to
recreate a new one. Don't do that.
Found by gcc's undefined behavior sanitizer.
2016-02-26 15:52:19 -05:00
Matthias Clasen
5ca860dcaf dialog: Avoid a memory leak in an error case
Parsing <action-widgets> could sometimes fail to free
some of the data, if a nonexisting widget is referenced.
Found by gcc's leak sanitizer.
2016-02-26 15:52:19 -05:00
Matthias Clasen
6108c646c5 cssselector: Don't invoke undefined behavior
Avoid undefined behavior in the calculation of some
hash values. Found by gcc's undefined behavior sanitizer.
2016-02-26 15:52:19 -05:00
Matthias Clasen
2cabfcc801 Avoid an a crash with GTK_DEBUG=builder
We might cast objects to GtkBuildable even if they aren't,
to print their names. Don't do that.

Found by gcc's address sanitizer.
2016-02-26 15:52:19 -05:00
Lapo Calamandrei
4fd5ad2f07 Adwaita: notebook tab sizing fix 2016-02-26 19:01:55 +01:00
Lapo Calamandrei
9f606b8270 Adwaita: stricter selector for split headerbar separator
with a descendant select was erroneusly catching normal headerbar
separators in paned split headerabar case, see gedit. Using a child
selector fixes.
2016-02-26 13:15:37 +01:00
Lapo Calamandrei
296a7c24f9 Adwaita: simplify mixed buttons styling 2016-02-26 13:07:09 +01:00
Lapo Calamandrei
1a0b6568fa Adwaita: fix separator in non paned using split headerbar
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=762593
2016-02-26 12:53:02 +01:00
Carlos Soriano
ea9e8221b1 gtkplacessidebar: use gpointers in trash row
It's the right casting. Forgot to push it with the previous patch.
2016-02-26 11:55:05 +01:00
Carlos Soriano
377ac909b7 gtkplacessidebar: clean up trash row on destroy
Track with a weak ref the trash row, so we can clean up the data in the
private struct.

Spotted and reviewed by Christian Hergert.
2016-02-26 11:52:50 +01:00
Benjamin Otte
34e204952e win32 theme: Make titlebuttons look like they're the right size
This is a hack because we can't really rtesize the buttons.

Instead, we draw the background only over the area that they would
be drawn if they were drawn by Windows. The button is still selectable
outside of this area, but what can you do...
2016-02-26 03:20:42 +01:00
Benjamin Otte
ad204c88ca win32 theme: Fix decorations
... and draw them properly.
2016-02-26 03:20:42 +01:00
Matthias Clasen
8b93c013c3 inspector: Simplify general tab setup
Factor out the code to create a listbox row with two labels,
and use it throughout.
2016-02-25 20:49:09 -05:00
Matthias Clasen
4f5f299266 inspector: React to device changes
Recreate the device section in the general tab when
devices come or go.
2016-02-25 20:28:23 -05:00
Benjamin Otte
5df1e98b2a window: Draw decorations in the right place
When we draw our own shadows, we need to offset the calls to render the
background to the border rectangle.
2016-02-25 23:21:29 +01:00
Matthias Clasen
09b1571093 Better baseline adjustment
The way we were adjusting baselines if min-height forces
a size increase was not quite working as intended. Redo
it in a simpler way: just split up the excess and count
half of it for above the baseline and half below.

This fixes button labels in dialogs appearing too low.
2016-02-25 16:36:13 -05:00
Matthias Clasen
a975e733dc fix a typo 2016-02-25 16:17:55 -05:00
Timm Bäder
0213815d2f Move .keycap docs from GtkFrame to GtkLabel
That's where .keycap is used nowadays.
2016-02-25 20:45:33 +01:00
Timm Bäder
77594be976 frame: Measure border gadget separately
https://bugzilla.gnome.org/show_bug.cgi?id=760482
2016-02-25 20:45:33 +01:00
Timm Bäder
3431451463 frame: Let GtkContainer handle border-width
https://bugzilla.gnome.org/show_bug.cgi?id=760482
2016-02-25 20:45:33 +01:00
Matthias Clasen
abd781a2c9 icon helper: Don't set baseline to 0
It is clearly not the intention that the baseline of icons is at
the very top. The visible effect of this was that spin buttons were
higher than expeted, because the box gadget was trying to line up
the baseline of the text with the top of the buttons, forcing extra
height to be requested.

Just don't set a baseline at all for now.
2016-02-25 13:18:02 -05:00
Benjamin Otte
3a9ceffe12 win32 theme: Make entries and textview work 2016-02-25 16:53:22 +01:00
Benjamin Otte
4e8fb33f56 pixelcache: Don't have a style context argument
That would imply the pixelcache monitors the style context for changes
and it doesn't do that.

Its only use case was opacity checks, so add
gtk_pixel_cache_se_is_opaque() instead.
2016-02-25 16:52:58 +01:00
Benjamin Otte
71a9fd9d83 stylecontext: Move background_is_opaque() function
The new way, it no longer depends on the style context, but on the
CssStyle. This will become relevant in the next commit.
2016-02-25 16:52:58 +01:00
Ignacio Casal Quinteiro
53fe9c2b0c inspector: use guint to fix the windows build 2016-02-25 15:25:19 +01:00
Carlos Soriano
20cf42c9ea gtkplacessidebar: avoid unresponsive UI while trashing
We were updating the whole places sidebar when the trash changed.
This effectively removes all rows and create new ones for every trash
state change.

Although when using GtkTreeView it was somehow ok, with the new
implementation with GtkListBox this effectively locks the UI while the
trash operations are being performed.

When performing operations for i.e. 100 files, the UI can be locked
for more than 1 minute since gvfs-trash usually takes time.

To fix this just update the icon of the trash when the state of the
trash change instead of the whole sidebar.

https://bugzilla.gnome.org/show_bug.cgi?id=762677
2016-02-25 14:44:40 +01:00
Matthias Clasen
fe4602acc5 inspector: Show ::num-touches for touch devices
This can be useful information.
2016-02-25 08:27:08 -05:00
Carlos Soriano
1977994128 gtkplacesview: clean up mount server callback
And fix a warning of unused variable.

Reviewed by Nacho on IRC
2016-02-25 13:45:20 +01:00
Matthias Clasen
84ba01d713 inspector: Update for screen config changes
Repopulate the display section whenever the monitor configuration
changes.
2016-02-25 01:22:01 -05:00
Matthias Clasen
15ccdcd25b inspector: Don't show numeric ids
The vendor and product ids for input devices aren't useful
as-is; need to figure out how to translate them to names.
2016-02-25 01:10:23 -05:00
Matthias Clasen
455935a06a inspector: Show more device information
This adds vendor and product id and axes. This reveals that
the GDK backends have quite different quality when it comes
to returning meaningful information here.
2016-02-25 00:49:50 -05:00
Matthias Clasen
03db14c2d6 inspector: Show some basic device information
Add information about seats and their associated devices
in the General tab.
2016-02-25 00:17:09 -05:00
Matthias Clasen
dde33623ca gadget: Warn about missing size allocation
When size_allocate is overridden in widgets, but draw is not,
we can end up drawing a gadget that has not been given a size.

Warn about this, and limp along by drawing the gadget over the
full allocation of its owner widget.

https://bugzilla.gnome.org/show_bug.cgi?id=762614
2016-02-24 22:22:11 -05:00
Benjamin Otte
760b540c8c treeview: Don't make things way too high
If the size-request is larger than the dedicated size, don't increase
the dedicated size by the size request, only increase it to the
size request.
2016-02-25 04:03:41 +01:00
Benjamin Otte
8ed804f1b4 textview: Draw the background properly
The background is *not* drawn relative to the clipping area.
2016-02-25 04:03:41 +01:00
Benjamin Otte
9016a00edd treeview: Fix positioning of editing widgets
This looks like a thinko.
2016-02-25 04:03:41 +01:00
Ben Iofel
e390e3b8e3 GtkIMContext: remove broken anchors in documentation 2016-02-24 14:37:35 -05:00
Carlos Garnacho
60d7f4376e GtkTextHandle: Look up for the first child of a scrolled window found
Text handles use to connect to the first GtkScrollable up the hierarchy
so they can be repositioned when scrolling. It makes more sense to look
up the first child of a GtkScrolledWindow, it must be an scrollable too,
and will be the scrollable that can actually change the position of the
text handles.

https://bugzilla.gnome.org/show_bug.cgi?id=761676
2016-02-24 17:58:19 +01:00
Jean-François Fortin Tam
cf6c0b09a5 spin button: Use the Ctrl modifier for Home and End key bindings
https://bugzilla.gnome.org/show_bug.cgi?id=309300
2016-02-23 21:20:00 -05:00
Timm Bäder
0c25c5d43d revealer: Don't report >0 preferred width...
... if the child is concealed and the transition type is set to NONE.
In this case, both preferred width and preferred height should be 0, but
we still can't use that to allocate a size for the child, so care about
the minimum size of the child in gtk_revealer_get_child_allocation.

https://bugzilla.gnome.org/show_bug.cgi?id=761760
2016-02-23 20:45:45 -05:00
Carlos Soriano
17a4bd51bb gtkplacesview: use location instead of the enclosing one
We were using the enclosing location when connecting to a server, so
for instance if  we were connecting to ftp://test/test it would actually
open ftp://test/ instead of the full path.

To fix it, use the full location when emitting the open location signal.

https://bugzilla.gnome.org/show_bug.cgi?id=756659
2016-02-23 20:42:01 -05:00
Carlos Garnacho
3d700515e1 GtkGestureMultiPress: reset multi-press sequence if the source device changes
This prevents multipress sequences to possibly come from different mice.
Now the accumulated number of presses will be reset if the device changes
in the mean time.

https://bugzilla.gnome.org/show_bug.cgi?id=723659
2016-02-23 20:35:01 -05:00
Carlos Soriano
63a204e1c5 gtkplacessidebar: add open flags to other locations
We weren't using the open flags on the other locations signal, which
makes impossible for applications like nautilus to act in the same
way that for any other location where the user can choose between
opening in the current view, in a new window or in a new tab.

Add the signal missing parameter in order to allow it.

https://bugzilla.gnome.org/show_bug.cgi?id=754743
2016-02-23 20:29:03 -05:00
Benjamin Otte
cf71d98b05 entry: Make the get_text_area() vfunc relative to top left of entry
This fixes GdTaggedEntry. I hope.
2016-02-23 04:22:19 +01:00
Benjamin Otte
3056d793a4 cssparser: Make _gtk_css_parser_has_number() a bit smarter
Previously we just checked the first character. And if that was a "-" as
in "-gtk-some-special-value", we assumed it was a number. Which it
clearly wasn't.

Test included
2016-02-23 04:22:19 +01:00
Benjamin Otte
437dec6295 csscolorvalue: Print a comma for win32 values 2016-02-23 04:22:19 +01:00
Benjamin Otte
c3dc0d80f1 container: Request layout again depending on layout mode
Containers with RESIZE_MODE_PARENT should never request layout and those
with RESIZE_MODE_IMMEDIATE should only request it for updating CSS.

Fixes clutter embeds (like the tray icon embed in gnome-shell)
continuously requesting relayout when all they want to do is relegate
relayout to Clutter.

https://bugzilla.gnome.org/show_bug.cgi?id=758893
2016-02-23 04:22:19 +01:00
Lapo Calamandrei
5906b15c5e Adwaita: avoids up pointing scale slider to jump down on hover
and comment back sass debugging stuff in the process...
2016-02-22 11:29:43 +01:00
Lapo Calamandrei
9fb9d208fd Adwaita: fix scale with marks sliders
looks like sass was confused by the way I structured the loops,
this works that around.
2016-02-22 11:16:32 +01:00
Lapo Calamandrei
7f89856b29 Adwaita: color scale slider fixes
use the pointy slider on colorscales, this way it picks the
correct slider on rtl.
2016-02-22 10:55:58 +01:00
Chun-wei Fan
5962daef4f Windows: Update how gtk-win32.rc is generated
On Visual Studio, unlike MinGW, manifest files are embedded via
including the manifest file as a resource file in the projects, not
via the .rc file.  This means that the line in the .rc file that
specifies the manifest file would cause trouble, so that line gets
removed when the full gtk3-win32.rc is generated on Visual Studio builds,
otherwise 2010+ Visual Studio will complain when compiling the .rc file.
Also, the inclusion of winuser.h will cause warnings during the
compilation of the .rc file.

Fix this by isolating the Win32 resource portions of gtk-win32.rc.in to
gtk-win32.rc.body.in and:
-On MinGW, construct the full gtk-win32.rc by doing the winver.h and
 winuser.h inclusion first, then append the contents of gtk-win32.rc.body,
 and then appending the line to embed the manifest file.
-On Visual Studio, simply copy the gtk-win32.rc.body to gtk-win32.rc,
 and generate the full libgtk3.manifest file.

https://bugzilla.gnome.org/show_bug.cgi?id=762311
2016-02-22 17:40:17 +08:00
Benjamin Otte
6c0270bbcb win32 theme: Make tooltips look right
Includes adding fallback support
2016-02-22 04:37:57 +01:00
Benjamin Otte
808017d1d0 win32 theme: Size titlebar icons correctly.
Sizing according to
http://web.archive.org/web/20070301202835/http://shellrevealed.com/photos/blog_images/images/4538/original.aspx
2016-02-22 04:37:57 +01:00
Benjamin Otte
414657100f win32draw: Use the right checks
The first check was the wrong way around.

The second check made the function look wrong. Invalid ID is actually
the special case that should be handled first, so write the function
like that.
2016-02-22 04:37:57 +01:00
Benjamin Otte
cdb12fec9e win32 theme: Replace metric ids with metric names
Makes it more obvious what's actually happening.
2016-02-22 04:37:57 +01:00
Benjamin Otte
dc1e191df5 csssizevalue: Allow using the name for a win32 metric
... instead of just the ID.
2016-02-22 04:37:56 +01:00
Benjamin Otte
98216867d1 win32: Allow querying names for metrics 2016-02-22 04:37:56 +01:00
Benjamin Otte
63934ba36c win32 theme: Replace color ids with color names
Makes it more obvious what's actually happening.
2016-02-22 02:36:11 +01:00
Benjamin Otte
37a4e1cda9 csscolor: Allow using the name for a win32 color
... instead of just the ID.
2016-02-22 02:36:11 +01:00
Benjamin Otte
ecaca073f1 win32: Allow querying names for colors 2016-02-22 02:36:11 +01:00
John Ralls
3cf98a4353 Fix typo. 2016-02-21 16:17:46 -08:00
Benjamin Otte
e935993d96 win32 fallback: Draw window title button images
Taken from Wine's Marlett font.
2016-02-21 20:44:37 +01:00
Benjamin Otte
828f2e1801 win32 theme: Sanitize a few colors 2016-02-21 20:44:36 +01:00
Benjamin Otte
2e709fde82 win32 fallback: Add code to draw titlebars 2016-02-21 20:44:36 +01:00
Benjamin Otte
3c5c748cd4 win32 fallback: Warn if we don't know how to draw a part 2016-02-21 20:44:36 +01:00
Benjamin Otte
c73db50aed win32: Implement GetSystemMetric() fallbacks
Default values taken from Wine.
2016-02-21 20:44:36 +01:00
Benjamin Otte
c2dd3c0d89 win32: Move variable definition to not cause gcc warning
It's only used on win32, so only define it there.
2016-02-21 20:44:36 +01:00
Matthias Clasen
0c91584532 Adwaita: Drop decoration.ssd selector
We've settled on window.ssd decoration instead.

https://bugzilla.gnome.org/show_bug.cgi?id=760714
2016-02-21 00:55:41 -05:00
Matthias Clasen
5a80a35757 drawingarea: Update docs around background handling
The behavior changed this cycle. Update the docs to recommend
an explicit gtk_render_background call.
2016-02-21 00:46:54 -05:00
Matthias Clasen
52e0ab53dc print dialog: More baseline alignment
Some places were missing the right valign setting to make
baselines line up properly.
2016-02-21 00:09:32 -05:00
Matthias Clasen
e9300e2f79 dnd: Avoid a crash
gtk_image_definition_new_icon_name ("") returns NULL. Bail
out early in this case to avoid unreffing NULL later.

https://bugzilla.gnome.org/show_bug.cgi?id=762392
2016-02-20 22:43:43 -05:00
Matthias Clasen
a754579e44 css gadget: Adjust baselines for min-height
We were forcing the size to be at least min-height, but we left the
baselines as they were, which had the effect of making text e.g
in entries 'stick to the top'.

With this change, we adjust the baseline to keep the ratio of
baseline to height unchanged.
2016-02-20 22:31:39 -05:00
Benjamin Otte
f3d67cc2ac win32 theme: Add rudimentary titlebar support 2016-02-21 03:02:36 +01:00
Benjamin Otte
eda348d2b5 win32: Handle size queries for all values
Fall back to GetSystemMetrics() whenever GetThemeSysSize() didn't work.
2016-02-21 03:02:36 +01:00
Benjamin Otte
63eb15b730 win32: Add missing break in switch statement
Oops.
2016-02-21 03:02:36 +01:00
Benjamin Otte
1548b680fc css: Make outline-offset animatable
CSS claims it should be, so we make it.
2016-02-21 01:02:51 +01:00
Benjamin Otte
e4a485dca2 renderborder: Add API to query the outline clip
And use it in implementation of gadgets.
2016-02-21 01:02:51 +01:00
Benjamin Otte
23b3774e6b css: Mark outline properties as affecting clip when they do 2016-02-21 01:02:51 +01:00
Matthias Clasen
966dd56e45 entry: Fix baseline allocation
Position the text on the baseline again.
2016-02-20 18:55:17 -05:00
Matthias Clasen
6b53138a01 box: Fix rtl allocation with center widget
The code for adjusting the center widget allocation in case
of uneven sides never worked right in RTL. This was finally
noticed for tabs with close button, which commonly use a
centered label.
2016-02-20 16:45:26 -05:00
Lapo Calamandrei
7698ac447a Adwaita: remove unused selector in _common.scss 2016-02-20 19:52:46 +01:00
Lapo Calamandrei
effee1f35e Revert "Adwaita: resurrect scale-has-marks-above/below classes"
This reverts commit edcc0c2783.
Since the colorscale styling is wrong in rtl, need to do things
differntly.
2016-02-20 19:50:49 +01:00
Lapo Calamandrei
44f6fcfbd3 Adwaita: move 1px up the check asset 2016-02-20 19:37:21 +01:00
Lapo Calamandrei
b23300c89d Adwaita: fix entry progressbar
it now moves using the whole entry lenght, in the process the
style was tweaked to not need a special case for focused entries.
2016-02-20 19:31:58 +01:00
Matthias Clasen
7c577ddf4f assistant: Add margin to action area
We are no longer setting a margin on the content area, so put
one on the action area itself to prevent the buttons from touching
the edge.

https://bugzilla.gnome.org/show_bug.cgi?id=762315
2016-02-20 11:27:56 -05:00
Lapo Calamandrei
edcc0c2783 Adwaita: resurrect scale-has-marks-above/below classes
the colorscales use said classes.
2016-02-20 17:25:51 +01:00
Matthias Clasen
d2454000f6 expander: Draw focus again
This was lost when GtkExpander was ported to use box gadgets.
2016-02-20 11:17:12 -05:00
Matthias Clasen
7ed1225296 check button: Draw focus again
The box gadget now has API for this; use it.
2016-02-20 10:54:48 -05:00
Matthias Clasen
ebff86d6f6 box gadget: Make it possible to draw focus
There are widgets which use a box gadget and take focus,
like GtkCheckButton.
2016-02-20 10:54:48 -05:00
Lapo Calamandrei
079e90b780 Adwaita: scale slider assets refresh
...and update the theme accordingly.
2016-02-20 16:07:00 +01:00
Benjamin Otte
d2fb069426 entry: Make get_text_area_size() vfunc work again
GdTaggedEntry needs that. Though there's probably a bunch of work left
inside GdTaggedEntry to make it look cute again (like storing the area
it reserves for itself to allocate tags in).
2016-02-20 03:25:39 +01:00
Lapo Calamandrei
a979cff748 Adwaita: check/radio/slider gradient tweaks 2016-02-19 18:03:38 +01:00
Lapo Calamandrei
09cd17a001 Revert "Adwaita: restrict button transition"
Shouldn't be needed with recent Benjamin work.
This reverts commit 79ca3f03a8.
2016-02-19 14:39:47 +01:00
Lapo Calamandrei
826913135b Revert "Adwaita: only needed properties on entry transition"
Shouldn't be needed with recent Benjamin work.
This reverts commit d57f4a781c.
2016-02-19 14:38:22 +01:00
Benjamin Otte
a3ba7f0a20 css: Don't start transitions when the value didn't change
This stops us from starting a lot of useless transitions. And it's even
conformant with the CSS spec!
2016-02-18 23:57:39 +01:00
Carlos Soriano
11b3efbdda gtkcsscalcvalue: avoid unitialized boolean
Since we do an OR afterwards, initializing to FALSE is correct.
2016-02-18 15:32:54 +01:00
Carlos Soriano
40c0a6aa87 gtkplacessidebar: remove unneeded condition
We check for it before anyway, and in this case make sense to show the
eject button in both cases.
2016-02-18 15:32:54 +01:00
Phillip Wood
934b3f6865 Document that GtkApplication loads gtk/menus-common.ui
Add a comment about the resource gtk/menus-common.ui to the
documentation of the other resources loaded by GtkApplication.

https://bugzilla.gnome.org/show_bug.cgi?id=761432
2016-02-18 14:11:14 +00:00
Phillip Wood
c38c3361ca Document help overlay action name in GtkApplication
This means all the information needed to automatically load a
shortcuts window and create a menu item to show it is in one place.

https://bugzilla.gnome.org/show_bug.cgi?id=761431
2016-02-18 14:11:14 +00:00
Lapo Calamandrei
d57f4a781c Adwaita: only needed properties on entry transition
made things properly in the process creating a sass function to
handle transition properties stacking.
2016-02-18 14:30:23 +01:00
Lapo Calamandrei
79ca3f03a8 Adwaita: restrict button transition
we use to animate "all" in the transition, this seems to trigger
some weird gtk sizing issue, restricting the transition to just
the needed properties fixes.
2016-02-18 13:24:42 +01:00
Lapo Calamandrei
a93fdd8201 Adwaita: housekeeping
cleaned up unneded selectors and leftovers from previous versions.
2016-02-18 12:26:19 +01:00
Lapo Calamandrei
56c54a20d1 Adwaita: reset the shadow on disabled scales 2016-02-17 20:00:57 +01:00
Lapo Calamandrei
9bb139c6aa Adwaita: unused assets cleanup 2016-02-17 15:22:36 +01:00
Lapo Calamandrei
d3c247ed21 Adwaita: added a new mixin for check/radio/sliders
some clean up in the process. The gradient still need some love.
2016-02-17 15:18:59 +01:00
Lapo Calamandrei
6bf33ac30c Adwaita: _drawing cleanup 2016-02-17 14:36:10 +01:00
Benjamin Otte
2782a14fc4 win32 theme: Add checkbutton spacing
The number is taken right from Wine source code.
2016-02-17 04:49:27 +01:00
Benjamin Otte
01bcda8a8c win32 theme: Query theme borders when rendering buttons
If someone figures out where the remaining pixel comes from: Tell me!
2016-02-17 04:49:27 +01:00
Benjamin Otte
67b893c5f8 win32 theme: Add a way to query border of theme parts 2016-02-17 04:49:26 +01:00
Benjamin Otte
a3998bce9d win32 theme: Add a hack that selects the right font on Windows 8
Someone needs to figure out why the default font is wrong.
2016-02-17 04:36:30 +01:00
Benjamin Otte
c98007f9fd win32: Add fallback code to draw theme parts 2016-02-17 04:36:18 +01:00
Benjamin Otte
37e3ccb2f6 win32: Split out fallback code into separate file
(1) Actual Windows users don't care about it
(2) It's easier to get rid of
2016-02-17 04:36:18 +01:00
Benjamin Otte
3e5be58991 win32 theme: Require comma between part and state ID 2016-02-17 04:36:18 +01:00
Matthias Clasen
da47ceb4c0 places sidebar: Use the right marshallers
We are passing the mount operation as argument, so use
a marshaller that expects an object argument.
2016-02-16 19:20:22 -05:00