revert to relative iconbar alignment when too many windows are open

This commit is contained in:
Mark Tiefenbruck 2009-06-28 03:40:50 -07:00
parent 02e0f9321c
commit fe92b6b39b
2 changed files with 19 additions and 23 deletions

View file

@ -1,5 +1,8 @@
(Format: Year/Month/Day)
Changes for 1.1.2
*09/06/28:
* Revert to relative iconbar alignment when too many windows are open (Mark)
FbTk/Container.cc
*09/05/26:
* Fixed unexpected window focus changes under "focus follows mouse" (Jim)
FocusControl.cc/hh Window.cc fluxbox.cc Screen.cc

View file

@ -410,31 +410,24 @@ void Container::repositionItems() {
unsigned int Container::maxWidthPerClient() const {
switch (alignment()) {
case RIGHT:
case CENTER:
case LEFT:
return m_max_size_per_client;
break;
case RELATIVE:
if (size() == 0)
return width();
else {
unsigned int borderW = m_item_list.front()->borderWidth();
// there're count-1 borders to fit in with the windows
// -> 1 per window plus end
unsigned int w = width(), h = height();
translateSize(m_orientation, w, h);
if (w < (size()-1)*borderW)
return 1;
else
return (w - (size() - 1) * borderW) / size();
}
break;
unsigned int max_relative_size;
if (size() == 0)
max_relative_size = width();
else {
unsigned int borderW = m_item_list.front()->borderWidth();
// there're count-1 borders to fit in with the windows
// -> 1 per window plus end
unsigned int w = width(), h = height();
translateSize(m_orientation, w, h);
max_relative_size = w < (size()-1)*borderW ? 1 :
(w - (size() - 1) * borderW) / size();
}
// this will never happen anyway
return 1;
if (alignment() == RELATIVE)
return max_relative_size;
return (m_max_size_per_client < max_relative_size ?
m_max_size_per_client : max_relative_size);
}
void Container::for_each(std::mem_fun_t<void, FbWindow> function) {