Compare commits

...

5 Commits

Author SHA1 Message Date
Carlos Soriano
2189fe3ed7 gtkplacesview: remove hover color from rows
Since other views are not using hover neither
2015-10-14 14:16:31 +02:00
Carlos Soriano
4de40baed9 gtkplacesview: align spinner with header label
Use the box margin top instead of the label margin top,
so the spinner remains aligned with the header label.
2015-10-14 14:16:31 +02:00
Carlos Soriano
d8bc98460c gtkplacesview: add a clear button to address entry
So it allows a quick way to clear the entry.
2015-10-14 14:16:30 +02:00
Carlos Soriano
258d685afd gtkplacesview: rotate server list icon on toggled
Disclosure triangles are usually used pointing down, however
in this case the popover spawns in the upper direction, which
makes it odd looking.
Instead of pointing always down or up, point down when not toggled and
animate a rotation when toggled.
2015-10-14 14:12:36 +02:00
Carlos Soriano
8a641f94c0 gtkplacesview: tweak ui to allow more server rows
Following design guidance, reduce row height and increase
popover height so the user is allowed to see more than 3
rows.
2015-10-14 14:10:20 +02:00
5 changed files with 76 additions and 7 deletions

View File

@@ -560,7 +560,7 @@ populate_servers (GtkPlacesView *view)
grid = g_object_new (GTK_TYPE_GRID,
"orientation", GTK_ORIENTATION_VERTICAL,
"border-width", 6,
"border-width", 3,
NULL);
/* name of the connected uri, if any */
@@ -1851,11 +1851,19 @@ on_address_entry_text_changed (GtkPlacesView *view)
priv = gtk_places_view_get_instance_private (view);
supported = FALSE;
supported_protocols = g_vfs_get_supported_uri_schemes (g_vfs_get_default ());
address = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->address_entry)));
if (strlen (address) > 0)
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (priv->address_entry),
GTK_ENTRY_ICON_SECONDARY,
"edit-clear-symbolic");
else
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (priv->address_entry),
GTK_ENTRY_ICON_SECONDARY,
NULL);
if (!supported_protocols)
return;
goto out;
address = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->address_entry)));
scheme = g_uri_parse_scheme (address);
if (!scheme)
@@ -1869,6 +1877,15 @@ out:
g_free (address);
}
static void
on_address_entry_clear_pressed (GtkPlacesView *view,
GtkEntryIconPosition icon_pos,
GdkEvent *event,
GtkEntry *entry)
{
gtk_entry_set_text (entry, "");
}
static void
on_recent_servers_listbox_row_activated (GtkPlacesView *view,
GtkPlacesViewRow *row,
@@ -1973,13 +1990,16 @@ listbox_header_func (GtkListBoxRow *row,
GtkWidget *label;
GtkWidget *separator;
header = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
header = g_object_new (GTK_TYPE_BOX,
"orientation", GTK_ORIENTATION_VERTICAL,
"spacing", 6,
"margin-top", 6,
NULL);
separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
label = g_object_new (GTK_TYPE_LABEL,
"use_markup", TRUE,
"margin-top", 6,
"margin-start", 12,
"label", text,
"xalign", 0.0f,
@@ -2243,6 +2263,7 @@ gtk_places_view_class_init (GtkPlacesViewClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GtkPlacesView, stack);
gtk_widget_class_bind_template_callback (widget_class, on_address_entry_text_changed);
gtk_widget_class_bind_template_callback (widget_class, on_address_entry_clear_pressed);
gtk_widget_class_bind_template_callback (widget_class, on_connect_button_clicked);
gtk_widget_class_bind_template_callback (widget_class, on_key_press_event);
gtk_widget_class_bind_template_callback (widget_class, on_listbox_row_activated);

View File

@@ -2913,6 +2913,26 @@ GtkPlacesSidebar.sidebar {
}
}
/****************
* File chooser *
****************/
GtkPlacesView {
.server-list-button > GtkImage {
transition: 200ms $ease-out-quad;
-gtk-icon-transform: rotate(0turn);
}
.server-list-button:checked > GtkImage {
transition: 200ms $ease-out-quad;
-gtk-icon-transform: rotate(-0.5turn);
}
.list-row.activatable:hover {
background-color: transparent;
}
}
/*********
* Paned *
*********/

View File

@@ -3966,6 +3966,18 @@ GtkPlacesSidebar.sidebar .sidebar-new-bookmark-row {
.sidebar-item.needs-attention > .label {
background-size: 6px 6px, 0 0; }
/****************
* File chooser *
****************/
GtkPlacesView .server-list-button > GtkImage {
transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
-gtk-icon-transform: rotate(0turn); }
GtkPlacesView .server-list-button:checked > GtkImage {
transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
-gtk-icon-transform: rotate(-0.5turn); }
GtkPlacesView .list-row.activatable:hover, GtkPlacesView GtkPlacesSidebar.sidebar .has-open-popup, GtkPlacesSidebar.sidebar GtkPlacesView .has-open-popup {
background-color: transparent; }
/*********
* Paned *
*********/

View File

@@ -4138,6 +4138,18 @@ GtkPlacesSidebar.sidebar .sidebar-new-bookmark-row {
.sidebar-item.needs-attention > .label {
background-size: 6px 6px, 0 0; }
/****************
* File chooser *
****************/
GtkPlacesView .server-list-button > GtkImage {
transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
-gtk-icon-transform: rotate(0turn); }
GtkPlacesView .server-list-button:checked > GtkImage {
transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
-gtk-icon-transform: rotate(-0.5turn); }
GtkPlacesView .list-row.activatable:hover, GtkPlacesView GtkPlacesSidebar.sidebar .has-open-popup, GtkPlacesSidebar.sidebar GtkPlacesView .has-open-popup {
background-color: transparent; }
/*********
* Paned *
*********/

View File

@@ -75,7 +75,7 @@
<property name="vexpand">1</property>
<property name="shadow_type">in</property>
<property name="min_content_width">250</property>
<property name="min_content_height">150</property>
<property name="min_content_height">200</property>
<child>
<object class="GtkViewport">
<property name="visible">1</property>
@@ -247,6 +247,7 @@
<property name="completion">address_entry_completion</property>
<signal name="notify::text" handler="on_address_entry_text_changed" object="GtkPlacesView" swapped="yes"/>
<signal name="activate" handler="on_connect_button_clicked" object="GtkPlacesView" swapped="yes"/>
<signal name="icon-press" handler="on_address_entry_clear_pressed" object="GtkPlacesView" swapped="yes"/>
</object>
</child>
<child>
@@ -256,10 +257,13 @@
<property name="receives_default">1</property>
<property name="direction">up</property>
<property name="popover">recent_servers_popover</property>
<style>
<class name="server-list-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="icon_name">pan-up-symbolic</property>
<property name="icon_name">pan-down-symbolic</property>
</object>
</child>
</object>