From 955e3865b66c46d3f0308d5ce809dab169d90613 Mon Sep 17 00:00:00 2001 From: fluxgen <fluxgen> Date: Sun, 23 Feb 2003 00:56:09 +0000 Subject: added toolbar placement resource --- src/Screen.cc | 13 +++++++++---- src/Screen.hh | 7 ++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index b9a3b21..ddce242 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.114 2003/02/22 16:09:44 rathnor Exp $ +// $Id: Screen.cc,v 1.115 2003/02/23 00:56:09 fluxgen Exp $ #include "Screen.hh" @@ -373,7 +373,8 @@ BScreen::ScreenResource::ScreenResource(ResourceManager &rm, toolbar_layernum(rm, Fluxbox::instance()->getDesktopLayer(), scrname+".toolbar.layer", altscrname+".Toolbar.Layer"), tab_placement(rm, Tab::PTOP, scrname+".tab.placement", altscrname+".Tab.Placement"), tab_alignment(rm, Tab::ALEFT, scrname+".tab.alignment", altscrname+".Tab.Alignment"), - toolbar_on_head(rm, 0, scrname+".toolbar.onhead", altscrname+".Toolbar.onHead") + toolbar_on_head(rm, 0, scrname+".toolbar.onhead", altscrname+".Toolbar.onHead"), + toolbar_placement(rm, Toolbar::BOTTOMCENTER, scrname+".toolbar.placement", altscrname+".Toolbar.Placement") { }; @@ -524,6 +525,7 @@ BScreen::BScreen(ResourceManager &rm, #endif // SLIT m_toolbar.reset(new Toolbar(*this, *layerManager().getLayer(getToolbarLayerNum()))); + m_toolbar->setPlacement(*resource.toolbar_placement); // setup toolbar width menu item FbTk::MenuItem *toolbar_menuitem = new IntResMenuItem("Toolbar width percent", resource.toolbar_width_percent, @@ -542,7 +544,7 @@ BScreen::BScreen(ResourceManager &rm, toolbar_menuitem->setCommand(reconfig_toolbar_and_save_resource); - m_toolbar->menu().insert(toolbar_menuitem); + m_toolbar->menu().insert(toolbar_menuitem, 0); setupWorkspacemenu(*this, *workspacemenu); @@ -758,8 +760,11 @@ void BScreen::reconfigure() { m_toolbar->theme().font().setAntialias(*resource.antialias); #ifdef SLIT - if (m_slit.get()) + if (m_slit.get()) { + m_slit->setPlacement(static_cast<Slit::Placement>(getSlitPlacement())); + m_slit->setDirection(static_cast<Slit::Direction>(getSlitDirection())); m_slit->reconfigure(); + } #endif // SLIT //reconfigure workspaces diff --git a/src/Screen.hh b/src/Screen.hh index 9488f3c..03a96b7 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.hh,v 1.71 2003/02/22 16:09:44 rathnor Exp $ +// $Id: Screen.hh,v 1.72 2003/02/23 00:55:07 fluxgen Exp $ #ifndef SCREEN_HH #define SCREEN_HH @@ -79,6 +79,7 @@ public: ~BScreen(); inline bool doToolbarAutoHide() const { return *resource.toolbar_auto_hide; } + inline Toolbar::Placement toolbarPlacement() const { return *resource.toolbar_placement; } inline bool isSloppyFocus() const { return (*resource.focus_model == Fluxbox::SLOPPYFOCUS); } inline bool isSemiSloppyFocus() const { return (*resource.focus_model == Fluxbox::SEMISLOPPYFOCUS); } inline bool isRootColormapInstalled() const { return root_colormap_installed; } @@ -196,7 +197,7 @@ public: inline void saveWorkspaces(int w) { *resource.workspaces = w; } inline void saveToolbarAutoHide(bool r) { *resource.toolbar_auto_hide = r; } inline void saveToolbarWidthPercent(int w) { *resource.toolbar_width_percent = w; } - + inline void saveToolbarPlacement(Toolbar::Placement place) { *resource.toolbar_placement = place; } inline void saveToolbarOnHead(int head) { *resource.toolbar_on_head = head; } @@ -394,7 +395,7 @@ private: Resource<Tab::Placement> tab_placement; Resource<Tab::Alignment> tab_alignment; Resource<int> toolbar_on_head; - + Resource<Toolbar::Placement> toolbar_placement; bool slit_auto_hide; int slit_placement, slit_direction; -- cgit v0.11.2