Moved panel handles into GDL
This commit is contained in:
parent
457a930f47
commit
ee50f55fa6
3 changed files with 2 additions and 55 deletions
|
|
@ -97,6 +97,7 @@ Panel::internal_setup()
|
|||
|
||||
GdlDockItemGrip *grip = GDL_DOCK_ITEM_GRIP(
|
||||
gdl_dock_item_get_grip(dock_item));
|
||||
gdl_dock_item_grip_show_handle(grip);
|
||||
gdl_dock_item_grip_set_label(grip, ((Widget&)panelBar).gobj());
|
||||
|
||||
gtk_container_add ((GtkContainer*)dock_item, (GtkWidget*)gobj());
|
||||
|
|
|
|||
|
|
@ -44,42 +44,5 @@ PanelBar::PanelBar(const gchar *stock_id) :
|
|||
pack_start(panelButton, PACK_SHRINK);
|
||||
}
|
||||
|
||||
bool
|
||||
PanelBar::on_expose_event(GdkEventExpose* event)
|
||||
{
|
||||
HBox::on_expose_event(event);
|
||||
|
||||
RefPtr<const Style> style = get_style();
|
||||
REQUIRE(style);
|
||||
|
||||
const Allocation allocation(get_allocation());
|
||||
const Gdk::Rectangle rect(
|
||||
allocation.get_x() - DragHandleSize, allocation.get_y(),
|
||||
DragHandleSize, allocation.get_height());
|
||||
|
||||
style->paint_handle(get_window(), STATE_NORMAL, SHADOW_NONE,
|
||||
rect, *this, "handlebox", rect.get_x(), rect.get_y(),
|
||||
rect.get_width(), rect.get_height(), ORIENTATION_VERTICAL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
PanelBar::on_size_allocate(Gtk::Allocation& allocation)
|
||||
{
|
||||
allocation.set_x(allocation.get_x() + DragHandleSize);
|
||||
HBox::on_size_allocate(allocation);
|
||||
}
|
||||
|
||||
void
|
||||
PanelBar::on_size_request(Gtk::Requisition* requisition)
|
||||
{
|
||||
REQUIRE(requisition);
|
||||
|
||||
HBox::on_size_request(requisition);
|
||||
|
||||
requisition->width += DragHandleSize;
|
||||
}
|
||||
|
||||
} // widgets
|
||||
} // gui
|
||||
|
|
|
|||
|
|
@ -45,24 +45,7 @@ public:
|
|||
* panel.
|
||||
**/
|
||||
PanelBar(const gchar *stock_id);
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* An override to intercept expose events.
|
||||
**/
|
||||
bool on_expose_event(GdkEventExpose* event);
|
||||
|
||||
/**
|
||||
* An override to intercept size allocate events.
|
||||
**/
|
||||
void on_size_allocate(Gtk::Allocation& allocation);
|
||||
|
||||
/**
|
||||
* An override to intercept size request events.
|
||||
**/
|
||||
void on_size_request(Gtk::Requisition* requisition);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue