all repos — fluxbox @ 87c97a966801bd1bdd38e11304061bdbe5248d2e

custom fork of the fluxbox windowmanager

since Button changed to a FbWindow we can change the container to hold fbwindows
fluxgen fluxgen
commit

87c97a966801bd1bdd38e11304061bdbe5248d2e

parent

86016331b02ae9480d48404701d81d4e28c2d8a4

2 files changed, 15 insertions(+), 16 deletions(-)

jump to
M src/Container.ccsrc/Container.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Container.cc,v 1.1 2003/08/11 15:28:33 fluxgen Exp $ +// $Id: Container.cc,v 1.2 2003/08/13 09:39:16 fluxgen Exp $ #include "FbTk/Button.hh" #include "Container.hh"

@@ -59,7 +59,7 @@ // make sure all items have parent == this

ItemList::iterator it = m_item_list.begin(); ItemList::iterator it_end = m_item_list.end(); for (; it != it_end; ++it) { - if ((*it)->window().parent() != this) + if ((*it)->parent() != this) return; }

@@ -87,7 +87,7 @@ if (find(item) != -1)

return; // it must be a child of this window - if (item->window().parent() != this) + if (item->parent() != this) return; if (pos >= size() || pos < 0) {

@@ -177,10 +177,15 @@ const ItemList::iterator it_end = m_item_list.end();

int next_x = 0; for (; it != it_end; ++it, next_x += max_width_per_client) { // resize each clients including border in size - (*it)->moveResize(next_x - (*it)->window().borderWidth(), - (*it)->window().borderWidth(), - max_width_per_client - (*it)->window().borderWidth(), - height() + (*it)->window().borderWidth()); + (*it)->moveResize(next_x - (*it)->borderWidth(), + -(*it)->borderWidth(), + max_width_per_client - (*it)->borderWidth(), + height() + (*it)->borderWidth()); (*it)->clear(); } } + + +unsigned int Container::maxWidthPerClient() const { + return (size() == 0 ? width() : (width() + size()*m_item_list.front()->borderWidth())/size()); +}
M src/Container.hhsrc/Container.hh

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Container.hh,v 1.1 2003/08/11 15:28:33 fluxgen Exp $ +// $Id: Container.hh,v 1.2 2003/08/13 09:39:16 fluxgen Exp $ #ifndef CONTAINER_HH #define CONTAINER_HH

@@ -31,15 +31,9 @@ #include "FbTk/NotCopyable.hh"

#include <list> -class ContainerTheme; - -namespace FbTk { -class Button; -}; - class Container:public FbTk::FbWindow, public FbTk::EventHandler, private FbTk::NotCopyable { public: - typedef FbTk::Button * Item; + typedef FbTk::FbWindow * Item; typedef std::list<Item> ItemList; explicit Container(const FbTk::FbWindow &parent);

@@ -65,7 +59,7 @@ // accessors

int size() const { return m_item_list.size(); } const Item selected() const { return m_selected; } Item selected() { return m_selected; } - unsigned int maxWidthPerClient() const { return (size() == 0 ? width() : width()/size()); } + unsigned int maxWidthPerClient() const; unsigned int maxHeightPerClient() const { return (size() == 0 ? height() : height()/size()); } private: void repositionItems();