aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-08-18 08:45:44 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-08-18 08:45:44 (GMT)
commita30a14ef36bda4ecfd8116963f641e8729350ab8 (patch)
tree2b59e55194ea0ac12663ccdf04d0010d31d46345 /src/Screen.cc
parenta23778a44d2469fdc414884f5fe72fde09c100cc (diff)
downloadfluxbox_pavel-a30a14ef36bda4ecfd8116963f641e8729350ab8.zip
fluxbox_pavel-a30a14ef36bda4ecfd8116963f641e8729350ab8.tar.bz2
add top, left, right, and bottom center tab placement options
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc51
1 files changed, 40 insertions, 11 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 271539d..c538d5e 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -207,20 +207,28 @@ namespace FbTk {
207template<> 207template<>
208void FbTk::Resource<FbWinFrame::TabPlacement>:: 208void FbTk::Resource<FbWinFrame::TabPlacement>::
209setFromString(const char *strval) { 209setFromString(const char *strval) {
210 if (strcasecmp(strval, "TopLeft")==0) 210 if (strcasecmp(strval, "TopLeft") == 0)
211 m_value = FbWinFrame::TOPLEFT; 211 m_value = FbWinFrame::TOPLEFT;
212 else if (strcasecmp(strval, "BottomLeft")==0) 212 else if (strcasecmp(strval, "BottomLeft") == 0)
213 m_value = FbWinFrame::BOTTOMLEFT; 213 m_value = FbWinFrame::BOTTOMLEFT;
214 else if (strcasecmp(strval, "TopRight")==0) 214 else if (strcasecmp(strval, "Top") == 0)
215 m_value = FbWinFrame::TOP;
216 else if (strcasecmp(strval, "Bottom") == 0)
217 m_value = FbWinFrame::BOTTOM;
218 else if (strcasecmp(strval, "TopRight") == 0)
215 m_value = FbWinFrame::TOPRIGHT; 219 m_value = FbWinFrame::TOPRIGHT;
216 else if (strcasecmp(strval, "BottomRight")==0) 220 else if (strcasecmp(strval, "BottomRight") == 0)
217 m_value = FbWinFrame::BOTTOMRIGHT; 221 m_value = FbWinFrame::BOTTOMRIGHT;
218 else if (strcasecmp(strval, "LeftTop") == 0) 222 else if (strcasecmp(strval, "LeftTop") == 0)
219 m_value = FbWinFrame::LEFTTOP; 223 m_value = FbWinFrame::LEFTTOP;
224 else if (strcasecmp(strval, "Left") == 0)
225 m_value = FbWinFrame::LEFT;
220 else if (strcasecmp(strval, "LeftBottom") == 0) 226 else if (strcasecmp(strval, "LeftBottom") == 0)
221 m_value = FbWinFrame::LEFTBOTTOM; 227 m_value = FbWinFrame::LEFTBOTTOM;
222 else if (strcasecmp(strval, "RightTop") == 0) 228 else if (strcasecmp(strval, "RightTop") == 0)
223 m_value = FbWinFrame::RIGHTTOP; 229 m_value = FbWinFrame::RIGHTTOP;
230 else if (strcasecmp(strval, "Right") == 0)
231 m_value = FbWinFrame::RIGHT;
224 else if (strcasecmp(strval, "RightBottom") == 0) 232 else if (strcasecmp(strval, "RightBottom") == 0)
225 m_value = FbWinFrame::RIGHTBOTTOM; 233 m_value = FbWinFrame::RIGHTBOTTOM;
226 else 234 else
@@ -237,6 +245,12 @@ getString() const {
237 case FbWinFrame::BOTTOMLEFT: 245 case FbWinFrame::BOTTOMLEFT:
238 return string("BottomLeft"); 246 return string("BottomLeft");
239 break; 247 break;
248 case FbWinFrame::TOP:
249 return string("Top");
250 break;
251 case FbWinFrame::BOTTOM:
252 return string("Bottom");
253 break;
240 case FbWinFrame::TOPRIGHT: 254 case FbWinFrame::TOPRIGHT:
241 return string("TopRight"); 255 return string("TopRight");
242 break; 256 break;
@@ -246,12 +260,18 @@ getString() const {
246 case FbWinFrame::LEFTTOP: 260 case FbWinFrame::LEFTTOP:
247 return string("LeftTop"); 261 return string("LeftTop");
248 break; 262 break;
263 case FbWinFrame::LEFT:
264 return string("Left");
265 break;
249 case FbWinFrame::LEFTBOTTOM: 266 case FbWinFrame::LEFTBOTTOM:
250 return string("LeftBottom"); 267 return string("LeftBottom");
251 break; 268 break;
252 case FbWinFrame::RIGHTTOP: 269 case FbWinFrame::RIGHTTOP:
253 return string("RightTop"); 270 return string("RightTop");
254 break; 271 break;
272 case FbWinFrame::RIGHT:
273 return string("Right");
274 break;
255 case FbWinFrame::RIGHTBOTTOM: 275 case FbWinFrame::RIGHTBOTTOM:
256 return string("RightBottom"); 276 return string("RightBottom");
257 break; 277 break;
@@ -1691,25 +1711,34 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1691 typedef list<PlacementP> Placements; 1711 typedef list<PlacementP> Placements;
1692 Placements place_menu; 1712 Placements place_menu;
1693 1713
1694 // menu is 2 wide, 2 down 1714 // menu is 3 wide, 5 down
1695 place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopLeft, "Top Left", "Top Left"), FbWinFrame::TOPLEFT)); 1715 place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopLeft, "Top Left", "Top Left"), FbWinFrame::TOPLEFT));
1696 place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftTop, "Left Top", "Left Top"), FbWinFrame::LEFTTOP)); 1716 place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftTop, "Left Top", "Left Top"), FbWinFrame::LEFTTOP));
1717 place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftCenter, "Left Center", "Left Center"), FbWinFrame::LEFT));
1697 place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftBottom, "Left Bottom", "Left Bottom"), FbWinFrame::LEFTBOTTOM)); 1718 place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftBottom, "Left Bottom", "Left Bottom"), FbWinFrame::LEFTBOTTOM));
1698 place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), FbWinFrame::BOTTOMLEFT)); 1719 place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), FbWinFrame::BOTTOMLEFT));
1720 place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopCenter, "Top Center", "Top Center"), FbWinFrame::TOP));
1721 place_menu.push_back(PlacementP("", FbWinFrame::TOPLEFT));
1722 place_menu.push_back(PlacementP("", FbWinFrame::TOPLEFT));
1723 place_menu.push_back(PlacementP("", FbWinFrame::TOPLEFT));
1724 place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomCenter, "Bottom Center", "Bottom Center"), FbWinFrame::BOTTOM));
1699 place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopRight, "Top Right", "Top Right"), FbWinFrame::TOPRIGHT)); 1725 place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopRight, "Top Right", "Top Right"), FbWinFrame::TOPRIGHT));
1700 place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightTop, "Right Top", "Right Top"), FbWinFrame::RIGHTTOP)); 1726 place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightTop, "Right Top", "Right Top"), FbWinFrame::RIGHTTOP));
1727 place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightCenter, "Right Center", "Right Center"), FbWinFrame::RIGHT));
1701 place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightBottom, "Right Bottom", "Right Bottom"), FbWinFrame::RIGHTBOTTOM)); 1728 place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightBottom, "Right Bottom", "Right Bottom"), FbWinFrame::RIGHTBOTTOM));
1702 place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), FbWinFrame::BOTTOMRIGHT)); 1729 place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), FbWinFrame::BOTTOMRIGHT));
1703 1730
1704 tabplacement_menu->setMinimumSublevels(2); 1731 tabplacement_menu->setMinimumSublevels(3);
1705 // create items in sub menu 1732 // create items in sub menu
1706 size_t i=0; 1733 for (size_t i=0; i<15; ++i) {
1707 while (!place_menu.empty()) {
1708 i++;
1709 FbTk::FbString &str = place_menu.front().first; 1734 FbTk::FbString &str = place_menu.front().first;
1710 FbWinFrame::TabPlacement placement = place_menu.front().second; 1735 FbWinFrame::TabPlacement placement = place_menu.front().second;
1711 1736 if (str == "") {
1712 tabplacement_menu->insert(new TabPlacementMenuItem(str, *this, placement, save_and_reconftabs)); 1737 tabplacement_menu->insert("");
1738 tabplacement_menu->setItemEnabled(i, false);
1739 } else {
1740 tabplacement_menu->insert(new TabPlacementMenuItem(str, *this, placement, save_and_reconftabs));
1741 }
1713 place_menu.pop_front(); 1742 place_menu.pop_front();
1714 } 1743 }
1715 tabplacement_menu->updateMenu(); 1744 tabplacement_menu->updateMenu();