aboutsummaryrefslogtreecommitdiff
path: root/src/Toolbar.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-05-15 12:00:46 (GMT)
committerfluxgen <fluxgen>2003-05-15 12:00:46 (GMT)
commit988392b1eb89deaddfddfcb37a15e8f55d58bb70 (patch)
tree493d69abd418722498d1b53982653eae1d4a37e6 /src/Toolbar.cc
parentcbce8634dde14fd7000fde92e86f4bd4bf3525c2 (diff)
downloadfluxbox-988392b1eb89deaddfddfcb37a15e8f55d58bb70.zip
fluxbox-988392b1eb89deaddfddfcb37a15e8f55d58bb70.tar.bz2
minor cleaning in BScreen interface
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r--src/Toolbar.cc50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 7bf8291..3053c09 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Toolbar.cc,v 1.81 2003/05/15 11:17:27 fluxgen Exp $ 25// $Id: Toolbar.cc,v 1.82 2003/05/15 12:00:45 fluxgen Exp $
26 26
27#include "Toolbar.hh" 27#include "Toolbar.hh"
28 28
@@ -250,20 +250,20 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi
250 editing(false), 250 editing(false),
251 hidden(scrn.doToolbarAutoHide()), 251 hidden(scrn.doToolbarAutoHide()),
252 do_auto_hide(scrn.doToolbarAutoHide()), 252 do_auto_hide(scrn.doToolbarAutoHide()),
253 frame(*this, scrn.getScreenNumber()), 253 frame(*this, scrn.screenNumber()),
254 m_screen(scrn), 254 m_screen(scrn),
255 m_clock_timer(this), // get the clock updating every minute 255 m_clock_timer(this), // get the clock updating every minute
256 m_hide_timer(&hide_handler), 256 m_hide_timer(&hide_handler),
257 m_toolbarmenu(menu), 257 m_toolbarmenu(menu),
258 m_placementmenu(*scrn.menuTheme(), 258 m_placementmenu(*scrn.menuTheme(),
259 scrn.getScreenNumber(), *scrn.getImageControl()), 259 scrn.screenNumber(), *scrn.getImageControl()),
260 m_layermenu(*scrn.menuTheme(), 260 m_layermenu(*scrn.menuTheme(),
261 scrn.getScreenNumber(), 261 scrn.screenNumber(),
262 *scrn.getImageControl(), 262 *scrn.getImageControl(),
263 *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), 263 *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()),
264 this, 264 this,
265 true), 265 true),
266 m_theme(scrn.getScreenNumber()), 266 m_theme(scrn.screenNumber()),
267 m_place(BOTTOMCENTER), 267 m_place(BOTTOMCENTER),
268 m_themelistener(*this), 268 m_themelistener(*this),
269 m_layeritem(frame.window, layer) { 269 m_layeritem(frame.window, layer) {
@@ -778,7 +778,7 @@ void Toolbar::checkClock(bool redraw, bool date) {
778 frame.clock.clear(); 778 frame.clock.clear();
779 m_theme.font().drawText( 779 m_theme.font().drawText(
780 frame.clock.window(), 780 frame.clock.window(),
781 screen().getScreenNumber(), 781 screen().screenNumber(),
782 m_theme.clockTextGC(), 782 m_theme.clockTextGC(),
783 t, newlen, 783 t, newlen,
784 dx, dy); 784 dx, dy);
@@ -813,7 +813,7 @@ void Toolbar::redrawWindowLabel(bool redraw) {
813 813
814 m_theme.font().drawText( 814 m_theme.font().drawText(
815 frame.window_label.window(), 815 frame.window_label.window(),
816 screen().getScreenNumber(), 816 screen().screenNumber(),
817 m_theme.windowTextGC(), 817 m_theme.windowTextGC(),
818 foc->title().c_str(), newlen, 818 foc->title().c_str(), newlen,
819 dx, dy); 819 dx, dy);
@@ -823,14 +823,14 @@ void Toolbar::redrawWindowLabel(bool redraw) {
823 823
824 824
825void Toolbar::redrawWorkspaceLabel(bool redraw) { 825void Toolbar::redrawWorkspaceLabel(bool redraw) {
826 if (screen().getCurrentWorkspace()->name().size()==0) 826 if (screen().currentWorkspace()->name().size()==0)
827 return; 827 return;
828 828
829 if (redraw) 829 if (redraw)
830 frame.workspace_label.clear(); 830 frame.workspace_label.clear();
831 831
832 const char *text = screen().getCurrentWorkspace()->name().c_str(); 832 const char *text = screen().currentWorkspace()->name().c_str();
833 size_t textlen = screen().getCurrentWorkspace()->name().size(); 833 size_t textlen = screen().currentWorkspace()->name().size();
834 unsigned int newlen = textlen; 834 unsigned int newlen = textlen;
835 int dx = FbTk::doAlignment(frame.workspace_label_w, frame.bevel_w, 835 int dx = FbTk::doAlignment(frame.workspace_label_w, frame.bevel_w,
836 m_theme.justify(), 836 m_theme.justify(),
@@ -844,7 +844,7 @@ void Toolbar::redrawWorkspaceLabel(bool redraw) {
844 } 844 }
845 m_theme.font().drawText( 845 m_theme.font().drawText(
846 frame.workspace_label.window(), 846 frame.workspace_label.window(),
847 screen().getScreenNumber(), 847 screen().screenNumber(),
848 m_theme.labelTextGC(), 848 m_theme.labelTextGC(),
849 text, newlen, 849 text, newlen,
850 dx, dy); 850 dx, dy);
@@ -906,8 +906,8 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
906 } 906 }
907 if (menu_x < 0) { 907 if (menu_x < 0) {
908 menu_x = 0; 908 menu_x = 0;
909 } else if (menu_x + wm.width() > screen().getWidth()) { 909 } else if (menu_x + wm.width() > screen().width()) {
910 menu_x = screen().getWidth() - wm.width(); 910 menu_x = screen().width() - wm.width();
911 } 911 }
912 fluxboxwin->showMenu(menu_x, menu_y); 912 fluxboxwin->showMenu(menu_x, menu_y);
913 913
@@ -919,13 +919,13 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
919 919
920 if (x < 0) 920 if (x < 0)
921 x = 0; 921 x = 0;
922 else if (x + m_toolbarmenu.width() > screen().getWidth()) 922 else if (x + m_toolbarmenu.width() > screen().width())
923 x = screen().getWidth() - m_toolbarmenu.width(); 923 x = screen().width() - m_toolbarmenu.width();
924 924
925 if (y < 0) 925 if (y < 0)
926 y = 0; 926 y = 0;
927 else if (y + m_toolbarmenu.height() > screen().getHeight()) 927 else if (y + m_toolbarmenu.height() > screen().height())
928 y = screen().getHeight() - m_toolbarmenu.height(); 928 y = screen().height() - m_toolbarmenu.height();
929 929
930 m_toolbarmenu.move(x, y); 930 m_toolbarmenu.move(x, y);
931 m_toolbarmenu.show(); 931 m_toolbarmenu.show();
@@ -949,13 +949,13 @@ void Toolbar::buttonReleaseEvent(XButtonEvent &re) {
949 int newy = menu->y(); // new y position of menu 949 int newy = menu->y(); // new y position of menu
950 if (menu->x() < 0) 950 if (menu->x() < 0)
951 newx = 0; 951 newx = 0;
952 else if (menu->x() + menu->width() > screen().getWidth()) 952 else if (menu->x() + menu->width() > screen().width())
953 newx = screen().getWidth() - menu->width(); 953 newx = screen().width() - menu->width();
954 954
955 if (menu->y() < 0) 955 if (menu->y() < 0)
956 newy = 0; 956 newy = 0;
957 else if (menu->y() + menu->height() > screen().getHeight()) 957 else if (menu->y() + menu->height() > screen().height())
958 newy = screen().getHeight() - menu->height(); 958 newy = screen().height() - menu->height();
959 // move and show menu 959 // move and show menu
960 menu->move(newx, newy); 960 menu->move(newx, newy);
961 menu->show(); 961 menu->show();
@@ -1029,7 +1029,7 @@ void Toolbar::keyPressEvent(XKeyEvent &ke) {
1029 XSetInputFocus(display, PointerRoot, None, CurrentTime); 1029 XSetInputFocus(display, PointerRoot, None, CurrentTime);
1030 1030
1031 if (ks == XK_Return) //change workspace name if keypress = Return 1031 if (ks == XK_Return) //change workspace name if keypress = Return
1032 screen().getCurrentWorkspace()->setName(new_workspace_name.c_str()); 1032 screen().currentWorkspace()->setName(new_workspace_name.c_str());
1033 1033
1034 new_workspace_name.erase(); //erase temporary workspace name 1034 new_workspace_name.erase(); //erase temporary workspace name
1035 reconfigure(); 1035 reconfigure();
@@ -1060,7 +1060,7 @@ void Toolbar::keyPressEvent(XKeyEvent &ke) {
1060 } 1060 }
1061 1061
1062 m_theme.font().drawText(frame.workspace_label.window(), 1062 m_theme.font().drawText(frame.workspace_label.window(),
1063 screen().getScreenNumber(), 1063 screen().screenNumber(),
1064 screen().winFrameTheme().labelTextFocusGC(), 1064 screen().winFrameTheme().labelTextFocusGC(),
1065 new_workspace_name.c_str(), l, 1065 new_workspace_name.c_str(), l,
1066 x, dy); 1066 x, dy);
@@ -1091,8 +1091,8 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
1091 1091
1092 m_place = where; 1092 m_place = where;
1093 1093
1094 head_w = screen().getWidth(); 1094 head_w = screen().width();
1095 head_h = screen().getHeight(); 1095 head_h = screen().height();
1096 1096
1097 frame.width = head_w * screen().getToolbarWidthPercent() / 100; 1097 frame.width = head_w * screen().getToolbarWidthPercent() / 100;
1098 frame.height = m_theme.font().height(); 1098 frame.height = m_theme.font().height();