added toolbar placement resource

This commit is contained in:
fluxgen 2003-02-23 00:56:09 +00:00
parent 50d8c9a8a1
commit 955e3865b6
2 changed files with 13 additions and 7 deletions

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // 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" #include "Screen.hh"
@ -373,7 +373,8 @@ BScreen::ScreenResource::ScreenResource(ResourceManager &rm,
toolbar_layernum(rm, Fluxbox::instance()->getDesktopLayer(), scrname+".toolbar.layer", altscrname+".Toolbar.Layer"), toolbar_layernum(rm, Fluxbox::instance()->getDesktopLayer(), scrname+".toolbar.layer", altscrname+".Toolbar.Layer"),
tab_placement(rm, Tab::PTOP, scrname+".tab.placement", altscrname+".Tab.Placement"), tab_placement(rm, Tab::PTOP, scrname+".tab.placement", altscrname+".Tab.Placement"),
tab_alignment(rm, Tab::ALEFT, scrname+".tab.alignment", altscrname+".Tab.Alignment"), 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 #endif // SLIT
m_toolbar.reset(new Toolbar(*this, *layerManager().getLayer(getToolbarLayerNum()))); m_toolbar.reset(new Toolbar(*this, *layerManager().getLayer(getToolbarLayerNum())));
m_toolbar->setPlacement(*resource.toolbar_placement);
// setup toolbar width menu item // setup toolbar width menu item
FbTk::MenuItem *toolbar_menuitem = new IntResMenuItem("Toolbar width percent", FbTk::MenuItem *toolbar_menuitem = new IntResMenuItem("Toolbar width percent",
resource.toolbar_width_percent, resource.toolbar_width_percent,
@ -542,7 +544,7 @@ BScreen::BScreen(ResourceManager &rm,
toolbar_menuitem->setCommand(reconfig_toolbar_and_save_resource); toolbar_menuitem->setCommand(reconfig_toolbar_and_save_resource);
m_toolbar->menu().insert(toolbar_menuitem); m_toolbar->menu().insert(toolbar_menuitem, 0);
setupWorkspacemenu(*this, *workspacemenu); setupWorkspacemenu(*this, *workspacemenu);
@ -758,8 +760,11 @@ void BScreen::reconfigure() {
m_toolbar->theme().font().setAntialias(*resource.antialias); m_toolbar->theme().font().setAntialias(*resource.antialias);
#ifdef SLIT #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(); m_slit->reconfigure();
}
#endif // SLIT #endif // SLIT
//reconfigure workspaces //reconfigure workspaces

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // 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 #ifndef SCREEN_HH
#define SCREEN_HH #define SCREEN_HH
@ -79,6 +79,7 @@ public:
~BScreen(); ~BScreen();
inline bool doToolbarAutoHide() const { return *resource.toolbar_auto_hide; } 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 isSloppyFocus() const { return (*resource.focus_model == Fluxbox::SLOPPYFOCUS); }
inline bool isSemiSloppyFocus() const { return (*resource.focus_model == Fluxbox::SEMISLOPPYFOCUS); } inline bool isSemiSloppyFocus() const { return (*resource.focus_model == Fluxbox::SEMISLOPPYFOCUS); }
inline bool isRootColormapInstalled() const { return root_colormap_installed; } inline bool isRootColormapInstalled() const { return root_colormap_installed; }
@ -196,7 +197,7 @@ public:
inline void saveWorkspaces(int w) { *resource.workspaces = w; } inline void saveWorkspaces(int w) { *resource.workspaces = w; }
inline void saveToolbarAutoHide(bool r) { *resource.toolbar_auto_hide = r; } inline void saveToolbarAutoHide(bool r) { *resource.toolbar_auto_hide = r; }
inline void saveToolbarWidthPercent(int w) { *resource.toolbar_width_percent = w; } 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; } inline void saveToolbarOnHead(int head) { *resource.toolbar_on_head = head; }
@ -394,7 +395,7 @@ private:
Resource<Tab::Placement> tab_placement; Resource<Tab::Placement> tab_placement;
Resource<Tab::Alignment> tab_alignment; Resource<Tab::Alignment> tab_alignment;
Resource<int> toolbar_on_head; Resource<int> toolbar_on_head;
Resource<Toolbar::Placement> toolbar_placement;
bool slit_auto_hide; bool slit_auto_hide;
int slit_placement, slit_direction; int slit_placement, slit_direction;