From b6263971cf8ce00b1f8feafc6c96ea0d3313e687 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Thu, 16 Apr 2009 18:28:49 +0100 Subject: [PATCH] Added PanelBar border padding support --- src/gui/widgets/panel-bar.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/panel-bar.cpp b/src/gui/widgets/panel-bar.cpp index 1b2cc2b01..1cfd09aed 100644 --- a/src/gui/widgets/panel-bar.cpp +++ b/src/gui/widgets/panel-bar.cpp @@ -146,6 +146,10 @@ PanelBar::on_size_request(Gtk::Requisition* requisition) requisition->height = max(requisition->height, child_requisition.height); } + + const int border_width = get_border_width(); + requisition->width += border_width * 2; + requisition->height += border_width * 2 ; ENSURE(requisition->width >= 0); ENSURE(requisition->height >= 0); @@ -159,6 +163,8 @@ PanelBar::on_size_allocate(Gtk::Allocation& allocation) Requisition requisition; Widget *widget; }; + + const int border_width = get_border_width(); // Use the offered allocation for this container set_allocation(allocation); @@ -192,10 +198,10 @@ PanelBar::on_size_allocate(Gtk::Allocation& allocation) RequestResult &result = requestResults[index]; Gtk::Allocation child_allocation( - offset, - (allocation.get_height() - result.requisition.height) / 2, - min(result.requisition.width, allocation.get_width() - offset), - result.requisition.height); + offset + border_width, + (allocation.get_height() - result.requisition.height) / 2, + min(result.requisition.width, allocation.get_width() - offset), + result.requisition.height); offset += result.requisition.width;