Commit 81024205 authored by Adrien Plazas's avatar Adrien Plazas
Browse files

preferences list style

parent b1bab301
Pipeline #52530 failed with stages
in 5 minutes and 37 seconds
......@@ -406,9 +406,6 @@ lists_page_init (HdyDemoWindow *self)
GListStore *list_store;
HdyValueObject *obj;
gtk_list_box_set_header_func (self->lists_listbox, hdy_list_box_separator_header, NULL, NULL);
gtk_list_box_set_header_func (self->nested_listbox, hdy_list_box_separator_header, NULL, NULL);
list_store = g_list_store_new (HDY_TYPE_VALUE_OBJECT);
obj = hdy_value_object_new_string ("Foo");
......@@ -436,12 +433,8 @@ hdy_demo_window_init (HdyDemoWindow *self)
hdy_combo_row_set_for_enum (self->leaflet_transition_row, HDY_TYPE_LEAFLET_TRANSITION_TYPE, leaflet_transition_name, NULL, NULL);
hdy_combo_row_set_selected_index (self->leaflet_transition_row, HDY_LEAFLET_TRANSITION_TYPE_OVER);
gtk_list_box_set_header_func (self->column_listbox, hdy_list_box_separator_header, NULL, NULL);
gtk_list_box_set_header_func (self->keypad_listbox, hdy_list_box_separator_header, NULL, NULL);
lists_page_init (self);
gtk_list_box_set_header_func (self->carousel_listbox, hdy_list_box_separator_header, NULL, NULL);
hdy_combo_row_set_for_enum (self->carousel_orientation_row, GTK_TYPE_ORIENTATION, carousel_orientation_name, NULL, NULL);
hdy_combo_row_set_for_enum (self->carousel_indicator_style_row, HDY_TYPE_CAROUSEL_INDICATOR_STYLE, carousel_indicator_style_name, NULL, NULL);
hdy_combo_row_set_selected_index (self->carousel_indicator_style_row, HDY_CAROUSEL_INDICATOR_STYLE_DOTS);
......
......@@ -373,7 +373,7 @@
<property name="expand">True</property>
<property name="selection-mode">none</property>
<style>
<class name="frame"/>
<class name="preferences"/>
</style>
<child>
<object class="HdyComboRow" id="leaflet_transition_row">
......@@ -507,7 +507,7 @@
<property name="expand">True</property>
<property name="selection-mode">none</property>
<style>
<class name="frame"/>
<class name="preferences"/>
</style>
<child>
<object class="HdyActionRow">
......@@ -691,7 +691,7 @@
<property name="expand">True</property>
<property name="selection-mode">none</property>
<style>
<class name="frame"/>
<class name="preferences"/>
</style>
<child>
<object class="HdyActionRow">
......@@ -845,7 +845,7 @@
<property name="expand">True</property>
<property name="selection-mode">none</property>
<style>
<class name="frame"/>
<class name="preferences"/>
</style>
<child>
<object class="HdyActionRow">
......@@ -930,48 +930,20 @@
<property name="show_enable_switch">True</property>
<property name="title" translatable="yes">Toggleable expander row</property>
<property name="visible">True</property>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">False</property>
<property name="visible">True</property>
<style>
<class name="expander"/>
</style>
<child>
<object class="GtkRevealer" id="nested_list_revealer">
<property name="reveal-child" bind-source="enable_expander_row" bind-property="expanded" bind-flags="sync-create"/>
<property name="transition_type">slide-up</property>
<object class="GtkListBox" id="nested_listbox">
<property name="selection_mode">none</property>
<property name="visible">True</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<object class="HdyActionRow">
<property name="title" translatable="yes">A nested row</property>
<property name="visible">True</property>
</object>
</child>
<child>
<object class="HdyActionRow">
<property name="title" translatable="yes">Another nested row</property>
<property name="visible">True</property>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
</object>
</child>
<child>
<object class="GtkListBox" id="nested_listbox">
<property name="margin-start">24</property>
<property name="selection_mode">none</property>
<property name="visible">True</property>
<child>
<object class="HdyActionRow">
<property name="title" translatable="yes">A nested row</property>
<property name="visible">True</property>
</object>
</child>
<child>
<object class="HdyActionRow">
<property name="title" translatable="yes">Another nested row</property>
<property name="visible">True</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
......@@ -1432,7 +1404,7 @@
<property name="valign">center</property>
<property name="selection-mode">none</property>
<style>
<class name="frame"/>
<class name="preferences"/>
</style>
<child>
<object class="HdyComboRow" id="carousel_orientation_row">
......
......@@ -9,6 +9,14 @@
* user provided styles.
*/
/* HdyActionRow */
row label.subtitle {
font-size: smaller;
opacity: 0.55;
text-shadow: none;
}
/* HdyComboRow */
popover list.transparent-background {
......@@ -28,22 +36,31 @@ list row.expander .header {
/* Animate the arrow's rotation */
row image.rotated-checked:checked:dir(ltr),
row image.rotated-checked:checked:dir(rtl) {
row:checked image.rotated-checked:dir(ltr),
row:checked image.rotated-checked:dir(rtl) {
transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
-gtk-icon-transform: rotate(0turn);
}
row image.rotated-checked:not(checked):dir(ltr) {
row:not(:checked) image.rotated-checked:dir(ltr) {
transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
-gtk-icon-transform: rotate(-0.25turn);
}
row image.rotated-checked:not(checked):dir(rtl) {
row:not(:checked) image.rotated-checked:dir(rtl) {
transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
-gtk-icon-transform: rotate(0.25turn);
}
row:not(:checked) image.rotated-checked {
opacity: 0.55;
text-shadow: none;
}
row:checked image.rotated-checked:not(:disabled) {
color: @theme_selected_bg_color;
}
row image.rotated-checked:disabled {
color: @insensitive_fg_color;
}
......@@ -205,3 +222,74 @@ viewswitcher > button.needs-attention > stack > box label:dir(rtl) {
viewswitcherbar actionbar > revealer > box {
padding: 0;
}
/* Rounded frame */
list.preferences {
background-color: transparent;
}
list.preferences > row {
background-color: @theme_base_color;
transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
list.preferences > row:checked +row {
background-color: @theme_base_color;
}
list.preferences > row:not(:last-child) {
border-color: alpha(@borders, 0.5);
border-style: solid;
border-width: 1px 1px 0px 1px;
}
list.preferences > row:first-child,
list.preferences > row:checked + row {
border-top-left-radius: 8px;
border-top-right-radius: 8px;
-gtk-outline-top-left-radius: 8px;
-gtk-outline-top-right-radius: 8px;
}
list.preferences > row {
transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
list.preferences > row:checked:not(:first-child),
list.preferences > row:checked + row {
margin-top: 6px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
-gtk-outline-top-left-radius: 8px;
-gtk-outline-top-right-radius: 8px;
}
list.preferences > row:last-child,
list.preferences > row.checked-expander-row-previous-sibbling,
list.preferences > row:checked {
border-color: alpha(@borders, 0.5);
border-style: solid;
border-width: 1px 1px 1px 1px;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
-gtk-outline-bottom-left-radius: 8px;
-gtk-outline-bottom-right-radius: 8px;
}
list.preferences > row list {
background-color: alpha(@theme_bg_color, 0.7);
}
list.preferences > row list > row {
border-color: alpha(@borders, 0.5);
border-style: solid;
border-width: 1px 0px 0px 0px;
}
list.preferences > row:checked list {
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
-gtk-outline-bottom-left-radius: 8px;
-gtk-outline-bottom-right-radius: 8px;
}
......@@ -50,6 +50,9 @@
<property name="hexpand">True</property>
<property name="visible">True</property>
<property name="xalign">0</property>
<style>
<class name="title"/>
</style>
</object>
</child>
<child>
......@@ -60,11 +63,11 @@
<property name="hexpand">True</property>
<property name="xalign">0</property>
<style>
<class name="dim-label" />
<class name="subtitle" />
</style>
<attributes>
<attribute name="scale" value="0.8" />
</attributes>
<!-- <attributes> -->
<!-- <attribute name="scale" value="0.8" /> -->
<!-- </attributes> -->
</object>
</child>
</object>
......
......@@ -55,11 +55,32 @@ static void
update_arrow (HdyExpanderRow *self)
{
HdyExpanderRowPrivate *priv = hdy_expander_row_get_instance_private (self);
GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (self));
GtkWidget *previous_sibbling = NULL;
if (parent) {
g_autoptr (GList) sibblings = gtk_container_get_children (GTK_CONTAINER (parent));
GList *l;
for (l = sibblings; l != NULL && l->next != NULL && l->next->data != self; l = l->next);
if (l->next->data == self)
previous_sibbling = l->data;
}
if (priv->expanded)
gtk_widget_set_state_flags (GTK_WIDGET (priv->image), GTK_STATE_FLAG_CHECKED, FALSE);
gtk_widget_set_state_flags (GTK_WIDGET (self), GTK_STATE_FLAG_CHECKED, FALSE);
else
gtk_widget_unset_state_flags (GTK_WIDGET (priv->image), GTK_STATE_FLAG_CHECKED);
gtk_widget_unset_state_flags (GTK_WIDGET (self), GTK_STATE_FLAG_CHECKED);
if (previous_sibbling) {
GtkStyleContext *context = gtk_widget_get_style_context (previous_sibbling);
if (priv->expanded)
gtk_style_context_add_class (context, "checked-expander-row-previous-sibbling");
else
gtk_style_context_remove_class (context, "checked-expander-row-previous-sibbling");
}
}
static void
......
......@@ -25,7 +25,7 @@
<child type="action">
<object class="GtkImage" id="image">
<property name="can_focus">False</property>
<property name="icon_name">pan-down-symbolic</property>
<property name="icon_name">go-down-symbolic</property>
<property name="icon_size">1</property>
<property name="sensitive" bind-source="HdyExpanderRow" bind-property="enable-expansion" bind-flags="sync-create"/>
<property name="visible">True</property>
......
......@@ -270,8 +270,6 @@ hdy_preferences_group_init (HdyPreferencesGroup *self)
gtk_widget_init_template (GTK_WIDGET (self));
gtk_list_box_set_header_func (priv->listbox, hdy_list_box_separator_header, NULL, NULL);
update_description_visibility (self);
update_title_visibility (self);
update_listbox_visibility (self);
......
......@@ -37,7 +37,7 @@
<signal name="add" handler="update_listbox_visibility" after="yes" swapped="yes"/>
<signal name="remove" handler="update_listbox_visibility" after="yes" swapped="yes"/>
<style>
<class name="frame"/>
<class name="preferences"/>
</style>
</object>
</child>
......
......@@ -382,7 +382,6 @@ hdy_preferences_window_init (HdyPreferencesWindow *self)
priv->title_label,
NULL);
gtk_list_box_set_header_func (priv->search_results, hdy_list_box_separator_header, NULL, NULL);
gtk_list_box_set_filter_func (priv->search_results, (GtkListBoxFilterFunc) filter_search_results, self, NULL);
update_pages_switcher_visibility (self);
......
......@@ -160,7 +160,7 @@
<property name="visible">True</property>
<signal name="row-activated" handler="search_result_activated" swapped="yes"/>
<style>
<class name="frame"/>
<class name="preferences"/>
</style>
</object>
</child>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment