Skip to content

Commit

Permalink
control-box: Do not clamp when floating mode is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
gnome-mpv committed Sep 9, 2024
1 parent 7fa0c36 commit cc8bf45
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/celluloid-control-box.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,10 +767,12 @@ celluloid_control_box_init(CelluloidControlBox *box)
set_narrow(box, box->narrow);
set_compact(box, box->compact);

// No need to set maximum size here. It will be set by
// celluloid_control_box_set_floating().
adw_bin_set_child(ADW_BIN(box), box->clamp);
adw_clamp_set_child(ADW_CLAMP(box->clamp), box->controls_box);
adw_clamp_set_maximum_size(ADW_CLAMP(box->clamp), 1000);
adw_clamp_set_tightening_threshold(ADW_CLAMP(box->clamp), 700);

box->inner_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_append(GTK_BOX(box->controls_box), box->title_widget);
gtk_box_append(GTK_BOX(box->controls_box), box->secondary_seek_bar);
Expand Down Expand Up @@ -936,6 +938,8 @@ celluloid_control_box_set_floating(CelluloidControlBox *box, gboolean floating)
(GTK_WIDGET(box->controls_box), "osd");
gtk_widget_set_visible
(GTK_WIDGET(box->title_widget), TRUE);
adw_clamp_set_maximum_size
(ADW_CLAMP(box->clamp), 1000);
}
else
{
Expand All @@ -945,6 +949,8 @@ celluloid_control_box_set_floating(CelluloidControlBox *box, gboolean floating)
(GTK_WIDGET(box->controls_box), "osd");
gtk_widget_set_visible
(GTK_WIDGET(box->title_widget), FALSE);
adw_clamp_set_maximum_size
(ADW_CLAMP(box->clamp), G_MAXINT);
}
}

Expand Down

0 comments on commit cc8bf45

Please sign in to comment.