Commit Graph

22079 Commits

Author SHA1 Message Date
Lapo Calamandrei
43a2676c3f Adwaita: fix selected colorswatch white border 2014-10-29 19:50:58 +01:00
Lapo Calamandrei
bfd4933aa3 Adwaita: first round of OSD style converage
Some code refactoring, entry and spinbuttons and flat buttons
styled, more to come...
2014-10-29 18:40:28 +01:00
Matthias Clasen
8765970ba1 Remove a redundant call
No need to set shapes twice in a row.
2014-10-29 06:49:59 -04:00
Matthias Clasen
0b4c37624a GtkPopoverMenu: Add API to open a submenu
This allows alternative menu switching to be implemented, besides
the builtin GtkModelButton support.
2014-10-29 06:49:59 -04:00
Matthias Clasen
6e001acbf9 Add documentation
Document GtkModelButton and GtkPopoverMenu.
2014-10-29 06:49:59 -04:00
Matthias Clasen
55b7838b4f GtkPopoverMenu: Simplify
Change things so each submenu is a single child, and users are
required to create the box themselves.
2014-10-29 06:49:59 -04:00
Matthias Clasen
689363a782 GtkModelButton: Don't require an explicit role
When we have an action-name, we can deduce the role from the
action that is looked up by the action helper.
2014-10-29 06:49:59 -04:00
Matthias Clasen
14e394d3d7 GtkModelButton: Rename action-role to role
Rename action-role to role, and make all properties readable.
2014-10-29 06:49:59 -04:00
Matthias Clasen
e776c665b0 GtkModelButton: Drop unused :accel property 2014-10-29 06:49:59 -04:00
Matthias Clasen
ef22be9bb7 Drop GtkModelButton:has-submenu
Replace the has-submenu property with checking menu-name != NULL.
2014-10-29 06:49:59 -04:00
Matthias Clasen
e095918128 GtkModelButton: Add a menu-name property
Add a menu-name property and use it in a default implementation
of ::clicked to switch menus if we are inside a stack. This means
GtkModelButton is no longer entirely generic, but rather expects
to be used inside a GtkPopoverMenu. It still works in other contexts
too, of course.
2014-10-29 06:49:58 -04:00
Matthias Clasen
1f81c83fd8 Add GtkPopoverMenu
GtkPopoverMenu is a GtkPopover subclass that has a menu-like stack
built-in.
2014-10-29 06:49:58 -04:00
Matthias Clasen
83976c47f8 Make GtkModelButton a better GtkActionable
Rename the "toggled" property to "active", since that is what
GtkActionHelper expects to update for check and radio actions.
Also make the property readable, since GtkActionHelper wants
to read it.
2014-10-29 06:49:58 -04:00
Matthias Clasen
fd945be50b Make GtkModelButton public 2014-10-29 06:49:58 -04:00
Matthias Clasen
c9ad936011 Drop an unused variable 2014-10-29 06:49:58 -04:00
Matthias Clasen
778865f316 Fix toplevel input shape for csd windows
We need to maintain the application-set and the the csd
input shape separately, and intersect them to pass them
down.
2014-10-28 20:23:47 -04:00
Matthias Clasen
4cf6edda55 wayland: Make window opacity work
Under wayland, the compositor doesn't have a 'overall window alpha'
knob, we just need to add the alpha to the buffers we send.
Client-side alpha, if you want to call it that.

Implement this by reusing the existing alpha support for non-toplevel
widgets. As a side-effect of the implementation, windows with RGBA
visual under X will now also use per-pixel alpha, instead of
overall alpha.
2014-10-28 10:28:23 -04:00
Matthias Clasen
850143b7a0 Inspector: Make picking work without a grab
Turns out Weston takes an X grab while delivering button events.
Thus, trying to take a grab in response to a button press is
futile.
2014-10-28 07:05:45 -04:00
Jasper St. Pierre
c40ba85ace wayland: Don't use the default display
Pass a display in so that multi-display technology works.
2014-10-27 22:29:41 -07:00
Matthias Clasen
86f66d26fe Drop an unused variable 2014-10-28 00:53:59 -04:00
Matthias Clasen
8aecf2c06a GtkAboutDialog: Don't use gdk_cursor_new
gdk_cursor_new returns cursors for the default display, and
thus is not safe to use in code that may run on non-default
displays.
2014-10-28 00:36:17 -04:00
Jasper St. Pierre
5f980cd8de gtkwindow: Use gdk_cursor_new_for_display
Otherwise, this crashes the inspector, since it now uses multi-display
technology, and on Wayland, resources like the cursor are client-private.
2014-10-27 21:22:44 -07:00
Jasper St. Pierre
5f40f58c36 cairoblur: Fix the blur again once more
The differences between the mutter and GTK+ code are subtle, but it
turns out that _gtk_cairo_blur_compute_pixels actually returns the
shadow *spread*. Since we use a triple box blur, the constant was
multiplied by 1.5 to approximate three chained box blurs. Split this
out and use the correct value for the lobe width.
2014-10-27 10:20:43 -07:00
Jasper St. Pierre
ac9ac55555 cairoblur: Fix the blur code
We weren't passing in the right "d" value, which was causing the blur to
behave incorrectly, especially in the case of 1px blurs, which would
cause no blurs at all.

The blur should now match the web.
2014-10-27 10:10:32 -07:00
Matthias Clasen
f1fe70e4ad Indentation fix 2014-10-27 07:19:50 -04:00
Sebastien Lafargue
17f9eed14e popover menus: Take iconic into account
We don't want separators in both side of an iconic section
and use a 10px margin to separate two iconic sections.

Separators are also updated in case of dynamic insertion
( often used with menu items for plugins )

https://bugzilla.gnome.org/show_bug.cgi?id=738650
2014-10-27 07:08:37 -04:00
Matthias Clasen
fc6f22c3ce Ignore gdk-pixbuf deprecations 2014-10-27 07:05:22 -04:00
Cosimo Cecchi
631e2f4c9b levelbar: don't use the current value style class for empty blocks
We want to be able to style the empty blocks independently of all the
offset styles, so remove the current style class when painting an empty
block.

https://bugzilla.gnome.org/show_bug.cgi?id=707695
2014-10-27 06:56:19 -04:00
Christophe Fergeau
506d59f526 Return correct font from gtk_font_chooser_widget_find_font
Commit 30a1c4ab fixed several memleaks including one in
gtk_font_chooser_widget_find_font.

However, the fix causes one extra call to gtk_tree_model_iter_next()
after finding the font we look for (ie pango_font_description_equal
returns TRUE): the 'increment' part of the for loop
(gtk_tree_model_iter_next) is run before the 'exit condition' of the for
loop is evaluated.

This commit reverts this part of commit 30a1c4ab and adds an extra
call to pango_font_description_free in order to fix the leak.

https://bugzilla.gnome.org/show_bug.cgi?id=739111
2014-10-26 21:53:33 -04:00
Christophe Fergeau
77487fef2f fontchooserwidget: Don't invalidate priv->font_iter in load_fonts
When using GtkFontChooserButton, the same GtkFontChooserWidget can be
hidden and shown multiple times. When doing that, the font that was
chosen the previous time should be the selected one in the
GtkFontChooserWidget, however this does not work as expected and a
somehow 'random' font gets selected (or none) instead.

Every time the font chooser widget is shown, its style will be updated,
causing gtk_font_chooser_widget_style_updated and then
gtk_font_chooser_widget_load_fonts to be called.

gtk_font_chooser_widget_load_fonts starts by clearing the GtkListStore
listing the available fonts, repopulates it, and then makes sure the
current font is selected.

However, this does not work as expected, as during the call to
gtk_list_store_clear, the cursor_changed_cb will be invoked multiple
times when the GtkTreeView cursor gets moved when the line where the
cursor currently is gets removed. This will cause the 'current font'
state (priv->font_desc) to be unexpectedly modified, and when
gtk_font_chooser_widget_load_fonts tries to reposition the cursor to the
'current font', we won't get the expect result.

This commit avoids that by making sure cursor_changed_cb does not get
called when we call gtk_list_store_clear in
gtk_font_chooser_widget_load_fonts.

https://bugzilla.gnome.org/show_bug.cgi?id=739111
2014-10-26 21:53:33 -04:00
Matthias Clasen
e41a8cf6fc Use GtkStack:vhomogeneous for popover menus
This allows us to get rid of a size group.
2014-10-26 15:03:58 -04:00
Matthias Clasen
b86356bc1c GtkStack: split homogeneous
Split homogeneous into separate hhomogeneous and vhomogeneous
properties. vhomogeneous is what we want for popover menus.
2014-10-26 14:59:21 -04:00
Timm Bäder
4d075cf202 popover: Use the right area for drawing the background
The border shouldn't be subtracted.
2014-10-26 15:21:06 +01:00
Matthias Clasen
8b6457732f GtkBox: Fix self-assignment for center widget
This is happening when glade is loading ui files containing
center widgets.
2014-10-25 20:30:08 -04:00
Matthias Clasen
041ccd7f87 GtkPlacesSidebar: Don't crash on dnd
gtk_get_current_event() can return NULL. Don't crash if it does.

https://bugzilla.gnome.org/show_bug.cgi?id=739150
2014-10-25 16:00:00 -04:00
Matthias Clasen
e35d91d18f Revert "Inspector backend hack"
This reverts commit f88a5dc8c7.

Didn't mean to push this.
2014-10-25 13:58:36 -04: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
f88a5dc8c7 Inspector backend hack 2014-10-25 10:33:22 -04:00
Matthias Clasen
23641e3103 inspector: Plug a memory leak 2014-10-25 10:00:57 -04:00
Matthias Clasen
bd031b89c1 inspector: Add style classes to the object list
We have a lot of space here now, so show some
useful information.
2014-10-25 10:00:39 -04:00
Matthias Clasen
182dd3c1ea Fix a mixup in popover realization
When the window is on a non-default screen, popover_realize
ended up passing a visual and a parent_window from different
screens into gdk_window_new, which doesn't work. Fix it by
using the visual of the parent window.
2014-10-24 23:36:35 -04:00
Matthias Clasen
a46d4e51f7 inspector: Improve details buttons
Ensure that the details buttons are only sensitive when
we actually have details to show.
2014-10-24 21:52:23 -04:00
Matthias Clasen
70c3241bd3 inspector: Improve tab switching
Switch the object and resource trees away from activate-on-single-click
and add a 'view details' button.
2014-10-24 21:14:16 -04:00
Matthias Clasen
4590501854 Properly update the style cascade on screen change
GtkStyleContext was not properly handling the style cascade when
setting a screen, causing the inspector global CSS to affect the
inspector window, even though the inspector is using a different
screen now.
2014-10-24 16:23:07 -04:00
Matthias Clasen
385e6beafe Fix the build
Some forgotten include path adjustments.
2014-10-24 16:12:33 -04:00
Matthias Clasen
c16fa45bfe inspector: Use a separate display connection
This helps isolate the inspector from some of the changes that
it can trigger. To specify a different display, set
GTK_INSPECTOR_DISPLAY to the name of the display to use for
the inspector window. If no display is specified, GTK+ will
use a separate connection to the default display.
2014-10-24 15:57:33 -04:00
Matthias Clasen
fea13fcfc1 Fix a problem with screen changes and csd
When a new screen is set on a window, we unrealize it, to
recreate all the resources. But we don't reset the client_decorated
flag, so realize() doesn't call create_decoration() - which makes
sense, since the decoration already exists. But the side-effect
of create_decoration() is to select the rgba visual, and visuals
are per-screen.

Fix this by looking for the rgba visual in set_screen(), and
replacing it with the rgba visual for the new screen, if necessary.
2014-10-24 15:57:33 -04:00
Benjamin Otte
2002613012 styleproperties: Move into deprecated directory 2014-10-24 21:31:40 +02:00
Benjamin Otte
a51378dda8 styleproperties: Deprecate 2014-10-24 21:31:40 +02:00
Benjamin Otte
433c20e59d styleproperties: Remove header where it's not used 2014-10-24 21:31:40 +02:00