mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-09-17 23:01:59 +00:00
name-cell: Improve subfolder loading indication
Reduce the timeout from 1 s to 200 ms and move the spinner after the name, not to move things around.
This commit is contained in:
parent
36fec089ec
commit
d1d482a490
|
@ -10,7 +10,7 @@
|
|||
#include "nautilus-file-utilities.h"
|
||||
#include "nautilus-thumbnails.h"
|
||||
|
||||
#define LOADING_TIMEOUT_SECONDS 1
|
||||
#define SPINNER_DELAY_MS 200
|
||||
|
||||
struct _NautilusNameCell
|
||||
{
|
||||
|
@ -273,7 +273,7 @@ on_item_is_cut_changed (NautilusNameCell *self)
|
|||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
on_loading_timeout (gpointer user_data)
|
||||
{
|
||||
NautilusNameCell *self = NAUTILUS_NAME_CELL (user_data);
|
||||
|
@ -287,8 +287,6 @@ on_loading_timeout (gpointer user_data)
|
|||
gtk_widget_set_visible (self->spinner, TRUE);
|
||||
gtk_spinner_start (GTK_SPINNER (self->spinner));
|
||||
}
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -301,8 +299,8 @@ on_item_is_loading_changed (NautilusNameCell *self)
|
|||
|
||||
if (is_loading)
|
||||
{
|
||||
self->loading_timeout_id = g_timeout_add_seconds (LOADING_TIMEOUT_SECONDS,
|
||||
G_SOURCE_FUNC (on_loading_timeout),
|
||||
self->loading_timeout_id = g_timeout_add_once (SPINNER_DELAY_MS,
|
||||
on_loading_timeout,
|
||||
self);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -19,14 +19,6 @@
|
|||
<property name="orientation">horizontal</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="valign">center</property>
|
||||
<child>
|
||||
<object class="GtkSpinner" id="spinner">
|
||||
<property name="visible">False</property>
|
||||
<property name="spinning">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="fixed_height_box">
|
||||
<property name="orientation">vertical</property>
|
||||
|
@ -85,6 +77,14 @@
|
|||
<property name="spacing">6</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinner" id="spinner">
|
||||
<property name="visible">False</property>
|
||||
<property name="spinning">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
|
|
Loading…
Reference in a new issue