[banshee] [Nereid] Make the search entry resizable
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] [Nereid] Make the search entry resizable
- Date: Wed, 13 Oct 2010 21:35:54 +0000 (UTC)
commit 1542c3db9554725a7e7c45b7273a4bff13720855
Author: Gabriel Burt <gabriel burt gmail com>
Date: Wed Oct 13 16:35:38 2010 -0500
[Nereid] Make the search entry resizable
src/Clients/Nereid/Nereid/PlayerInterface.cs | 14 ++++--
.../Banshee.Gui.Widgets/ConnectedSeekSlider.cs | 56 +------------------
src/Hyena | 2 +-
3 files changed, 14 insertions(+), 58 deletions(-)
---
diff --git a/src/Clients/Nereid/Nereid/PlayerInterface.cs b/src/Clients/Nereid/Nereid/PlayerInterface.cs
index 20cdb9c..8f83fdb 100644
--- a/src/Clients/Nereid/Nereid/PlayerInterface.cs
+++ b/src/Clients/Nereid/Nereid/PlayerInterface.cs
@@ -166,10 +166,16 @@ namespace Nereid
BuildViews ();
BuildFooter ();
- var box = new Alignment (1.0f, 0.5f, 0f, 0f);
- box.Child = view_container.SearchEntry;
- ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/SearchEntry", box);
- box.ShowAll ();
+ var align = new Alignment (1.0f, 0.5f, 0f, 0f);
+ var box = new HBox () { Spacing = 2 };
+ var grabber = new GrabHandle ();
+ grabber.ControlWidthOf (view_container.SearchEntry, 150, 350, false);
+ box.PackStart (grabber, false, false, 0);
+ box.PackStart (view_container.SearchEntry, false, false, 0);
+ align.Child = box;
+
+ ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/SearchEntry", align);
+ align.ShowAll ();
primary_vbox.Show ();
Add (primary_vbox);
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedSeekSlider.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedSeekSlider.cs
index 852ff5a..65368fd 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedSeekSlider.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedSeekSlider.cs
@@ -45,7 +45,7 @@ namespace Banshee.Gui.Widgets
private SeekSlider seek_slider;
private StreamPositionLabel stream_position_label;
private Box box;
- private GrabHandle grabber;
+ private Hyena.Widgets.GrabHandle grabber;
public ConnectedSeekSlider () : this (SeekSliderLayout.Vertical)
{
@@ -118,12 +118,8 @@ namespace Banshee.Gui.Widgets
hbox.PackStart (box, true, true, 0);
- grabber = new GrabHandle (5, 28);
- grabber.MotionNotifyEvent += (o, a) => {
- var x = a.Event.X;
- var w = Math.Min (1024, Math.Max (125, seek_slider.WidthRequest + x));
- seek_slider.WidthRequest = (int)w;
- };
+ grabber = new Hyena.Widgets.GrabHandle ();
+ grabber.ControlWidthOf (seek_slider, 125, 1024, true);
hbox.PackStart (grabber, true, true, 0);
hbox.ShowAll ();
@@ -141,52 +137,6 @@ namespace Banshee.Gui.Widgets
}
}
- private class GrabHandle : EventBox
- {
- Gtk.DrawingArea da;
-
- public GrabHandle (int w, int h)
- {
- da = new DrawingArea ();
- da.SetSizeRequest (w, h);
- Orientation = Gtk.Orientation.Vertical;
-
- Child = da;
- ShowAll ();
-
- ButtonPressEvent += (o, a) => Dragging = true;
- ButtonReleaseEvent += (o, a) => Dragging = false;
- EnterNotifyEvent += (o, a) => Inside = true;
- LeaveNotifyEvent += (o, a) => Inside = false;
-
- da.ExposeEvent += (o, a) => {
- if (da.IsDrawable) {
- Gtk.Style.PaintHandle (da.Style, da.GdkWindow, da.State, ShadowType.In,
- a.Event.Area, this, "entry", 0, 0, da.Allocation.Width, da.Allocation.Height, Orientation);
- }
- };
- }
-
- public Gtk.Orientation Orientation { get; set; }
-
- private bool inside, dragging;
- private bool Inside {
- set {
- inside = value;
- GdkWindow.Cursor = dragging || inside ? resize_cursor : null;
- }
- }
-
- private bool Dragging {
- set {
- dragging = value;
- GdkWindow.Cursor = dragging || inside ? resize_cursor : null;
- }
- }
-
- private static Gdk.Cursor resize_cursor = new Gdk.Cursor (Gdk.CursorType.SbHDoubleArrow);
- }
-
private bool transitioning = false;
private bool OnTrackIntercept (Banshee.Collection.TrackInfo track)
{
diff --git a/src/Hyena b/src/Hyena
index db64478..37c984f 160000
--- a/src/Hyena
+++ b/src/Hyena
@@ -1 +1 @@
-Subproject commit db644786b7424823b37d01410da8c60b102980d5
+Subproject commit 37c984fc7254403c5ca8ed0095616f3af9715e79
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]