Commit b973f7f3 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request !2737
parents 6ce2e19b 7671c107
Pipeline #223504 passed with stages
in 21 minutes and 18 seconds
......@@ -251,6 +251,8 @@ gtk_drop_down_dispose (GObject *object)
{
GtkDropDown *self = GTK_DROP_DOWN (object);
gtk_widget_unparent (gtk_widget_get_first_child (self->search_entry));
g_clear_pointer (&self->popup, gtk_widget_unparent);
g_clear_pointer (&self->button, gtk_widget_unparent);
......@@ -594,11 +596,19 @@ set_default_factory (GtkDropDown *self)
static void
gtk_drop_down_init (GtkDropDown *self)
{
GtkWidget *icon;
g_type_ensure (GTK_TYPE_BUILTIN_ICON);
g_type_ensure (GTK_TYPE_LIST_ITEM_WIDGET);
gtk_widget_init_template (GTK_WIDGET (self));
icon = g_object_new (GTK_TYPE_IMAGE,
"accessible-role", GTK_ACCESSIBLE_ROLE_NONE,
"icon-name", "system-search-symbolic",
NULL);
gtk_widget_insert_after (icon, self->search_entry, NULL);
set_default_factory (self);
}
......
......@@ -34,6 +34,9 @@
#include "gtkpasswordentrybufferprivate.h"
#include "gtkprivate.h"
#include "gtkwidgetprivate.h"
#include "gtkcsspositionvalueprivate.h"
#include "gtkstylecontextprivate.h"
/**
* SECTION:gtkpasswordentry
......@@ -350,7 +353,7 @@ gtk_password_entry_measure (GtkWidget *widget,
gtk_widget_measure (entry->icon, orientation, for_size,
&icon_min, &icon_nat,
NULL, NULL);
if (entry->peek_icon && gtk_widget_get_visible (entry->peek_icon))
gtk_widget_measure (entry->peek_icon, orientation, for_size,
&icon_min, &icon_nat,
......@@ -364,21 +367,26 @@ gtk_password_entry_size_allocate (GtkWidget *widget,
int baseline)
{
GtkPasswordEntry *entry = GTK_PASSWORD_ENTRY (widget);
GtkCssStyle *style = gtk_css_node_get_style (gtk_widget_get_css_node (widget));
int icon_min = 0, icon_nat = 0;
int peek_min = 0, peek_nat = 0;
int text_width;
int spacing;
spacing = _gtk_css_position_value_get_x (style->size->border_spacing, 100);
if (entry->icon && gtk_widget_get_visible (entry->icon))
gtk_widget_measure (entry->icon, GTK_ORIENTATION_HORIZONTAL, -1,
&icon_min, &icon_nat,
NULL, NULL);
if (entry->peek_icon && gtk_widget_get_visible (entry->peek_icon))
gtk_widget_measure (entry->peek_icon, GTK_ORIENTATION_HORIZONTAL, -1,
&peek_min, &peek_nat,
NULL, NULL);
text_width = width - icon_nat - peek_nat;
text_width = width - (icon_nat + (icon_nat > 0 ? spacing : 0))
- (peek_nat + (peek_nat > 0 ? spacing : 0));
gtk_widget_size_allocate (entry->entry,
&(GtkAllocation) { 0, 0, text_width, height },
......@@ -386,12 +394,12 @@ gtk_password_entry_size_allocate (GtkWidget *widget,
if (entry->icon && gtk_widget_get_visible (entry->icon))
gtk_widget_size_allocate (entry->icon,
&(GtkAllocation) { text_width, 0, icon_nat, height },
&(GtkAllocation) { text_width + spacing, 0, icon_nat, height },
baseline);
if (entry->peek_icon && gtk_widget_get_visible (entry->peek_icon))
gtk_widget_size_allocate (entry->peek_icon,
&(GtkAllocation) { text_width + icon_nat, 0, peek_nat, height },
&(GtkAllocation) { text_width + spacing + icon_nat + (icon_nat > 0 ? spacing : 0), 0, peek_nat, height },
baseline);
}
......
......@@ -283,6 +283,7 @@ entry {
padding-right: 8px;
border: 1px solid;
border-radius: $button_radius;
border-spacing: 6px;
transition: all 200ms $ease-out-quad;
@include entry(normal);
......
......@@ -847,7 +847,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<child>
<object class="GtkFontButton" id="fontbutton1">
<property name="receives-default">1</property>
<property name="level">family|style|size|features|variations</property>
<property name="level">family|size|features|variations</property>
</object>
</child>
<child>
......@@ -1013,7 +1013,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="adjustment">adjustment1</property>
<property name="restrict-to-fill-level">0</property>
<property name="fill-level">75</property>
<property name="digits">-1</property>
<property name="digits">1</property>
<property name="draw-value">1</property>
<property name="halign">end</property>
</object>
......@@ -1026,7 +1026,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="adjustment">adjustment1</property>
<property name="restrict-to-fill-level">0</property>
<property name="fill-level">75</property>
<property name="digits">-1</property>
<property name="digits">1</property>
<property name="draw-value">1</property>
<property name="halign">start</property>
</object>
......@@ -1081,7 +1081,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
</style>
<child type="label">
<object class="GtkLabel" id="label17">
<property name="label" translatable="yes">&lt;b&gt;Groove&lt;/b&gt;</property>
<property name="label" translatable="yes">&lt;b&gt;Groove, Groove, Groove&lt;/b&gt;</property>
<property name="use-markup">1</property>
</object>
</child>
......
......@@ -1014,7 +1014,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="adjustment">adjustment1</property>
<property name="restrict-to-fill-level">0</property>
<property name="fill-level">75</property>
<property name="digits">-1</property>
<property name="digits">1</property>
<property name="draw-value">1</property>
<property name="halign">end</property>
</object>
......@@ -1027,7 +1027,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="adjustment">adjustment1</property>
<property name="restrict-to-fill-level">0</property>
<property name="fill-level">75</property>
<property name="digits">-1</property>
<property name="digits">1</property>
<property name="draw-value">1</property>
<property name="halign">start</property>
</object>
......
......@@ -1014,7 +1014,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="adjustment">adjustment1</property>
<property name="restrict-to-fill-level">0</property>
<property name="fill-level">75</property>
<property name="digits">-1</property>
<property name="digits">1</property>
<property name="draw-value">1</property>
<property name="halign">end</property>
</object>
......@@ -1027,7 +1027,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="adjustment">adjustment1</property>
<property name="restrict-to-fill-level">0</property>
<property name="fill-level">75</property>
<property name="digits">-1</property>
<property name="digits">1</property>
<property name="draw-value">1</property>
<property name="halign">start</property>
</object>
......
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