aboutsummaryrefslogtreecommitdiff
path: root/src/Container.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Container.cc')
-rw-r--r--src/Container.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/Container.cc b/src/Container.cc
index 0fff44a..6c2dfef 100644
--- a/src/Container.cc
+++ b/src/Container.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: Container.cc,v 1.1 2003/08/11 15:28:33 fluxgen Exp $ 23// $Id: Container.cc,v 1.2 2003/08/13 09:39:16 fluxgen Exp $
24 24
25#include "FbTk/Button.hh" 25#include "FbTk/Button.hh"
26#include "Container.hh" 26#include "Container.hh"
@@ -59,7 +59,7 @@ void Container::insertItems(ItemList &item_list, int pos) {
59 ItemList::iterator it = m_item_list.begin(); 59 ItemList::iterator it = m_item_list.begin();
60 ItemList::iterator it_end = m_item_list.end(); 60 ItemList::iterator it_end = m_item_list.end();
61 for (; it != it_end; ++it) { 61 for (; it != it_end; ++it) {
62 if ((*it)->window().parent() != this) 62 if ((*it)->parent() != this)
63 return; 63 return;
64 } 64 }
65 65
@@ -87,7 +87,7 @@ void Container::insertItem(Item item, int pos) {
87 return; 87 return;
88 88
89 // it must be a child of this window 89 // it must be a child of this window
90 if (item->window().parent() != this) 90 if (item->parent() != this)
91 return; 91 return;
92 92
93 if (pos >= size() || pos < 0) { 93 if (pos >= size() || pos < 0) {
@@ -177,10 +177,15 @@ void Container::repositionItems() {
177 int next_x = 0; 177 int next_x = 0;
178 for (; it != it_end; ++it, next_x += max_width_per_client) { 178 for (; it != it_end; ++it, next_x += max_width_per_client) {
179 // resize each clients including border in size 179 // resize each clients including border in size
180 (*it)->moveResize(next_x - (*it)->window().borderWidth(), 180 (*it)->moveResize(next_x - (*it)->borderWidth(),
181 (*it)->window().borderWidth(), 181 -(*it)->borderWidth(),
182 max_width_per_client - (*it)->window().borderWidth(), 182 max_width_per_client - (*it)->borderWidth(),
183 height() + (*it)->window().borderWidth()); 183 height() + (*it)->borderWidth());
184 (*it)->clear(); 184 (*it)->clear();
185 } 185 }
186} 186}
187
188
189unsigned int Container::maxWidthPerClient() const {
190 return (size() == 0 ? width() : (width() + size()*m_item_list.front()->borderWidth())/size());
191}