update for rootheme

This commit is contained in:
fluxgen 2003-04-25 11:19:45 +00:00
parent 8bbc39b8d0
commit 9f0885bcbe

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: Toolbar.cc,v 1.73 2003/04/23 00:17:51 fluxgen Exp $ // $Id: Toolbar.cc,v 1.74 2003/04/25 11:19:45 fluxgen Exp $
#include "Toolbar.hh" #include "Toolbar.hh"
@ -39,6 +39,7 @@
#include "SimpleCommand.hh" #include "SimpleCommand.hh"
#include "IntResMenuItem.hh" #include "IntResMenuItem.hh"
#include "MacroCommand.hh" #include "MacroCommand.hh"
#include "RootTheme.hh"
// use GNU extensions // use GNU extensions
#ifndef _GNU_SOURCE #ifndef _GNU_SOURCE
@ -401,7 +402,7 @@ void Toolbar::reconfigure() {
if (m_iconbar.get()) if (m_iconbar.get())
m_iconbar->setVertical(vertical); m_iconbar->setVertical(vertical);
frame.bevel_w = screen().getBevelWidth(); frame.bevel_w = screen().rootTheme().bevelWidth();
// recallibrate size // recallibrate size
setPlacement(m_place); setPlacement(m_place);
@ -639,8 +640,8 @@ void Toolbar::reconfigure() {
if (tmp) if (tmp)
image_ctrl.removeImage(tmp); image_ctrl.removeImage(tmp);
frame.window.setBorderColor(*screen().getBorderColor()); frame.window.setBorderColor(screen().rootTheme().borderColor());
frame.window.setBorderWidth(screen().getBorderWidth()); frame.window.setBorderWidth(screen().rootTheme().borderWidth());
frame.window.clear(); frame.window.clear();
@ -844,7 +845,7 @@ void Toolbar::edit() {
fluxbox->getFocusedWindow()->setFocusFlag(false); fluxbox->getFocusedWindow()->setFocusFlag(false);
XDrawRectangle(display, frame.workspace_label.window(), XDrawRectangle(display, frame.workspace_label.window(),
screen().getWindowStyle()->l_text_focus_gc, screen().winFrameTheme().labelTextFocusGC(),
frame.workspace_label_w / 2, 0, 1, frame.workspace_label_w / 2, 0, 1,
frame.label_h - 1); frame.label_h - 1);
} }
@ -1030,15 +1031,15 @@ void Toolbar::keyPressEvent(XKeyEvent &ke) {
x = tmp; x = tmp;
} }
m_theme.font().drawText( m_theme.font().drawText(frame.workspace_label.window(),
frame.workspace_label.window(),
screen().getScreenNumber(), screen().getScreenNumber(),
screen().getWindowStyle()->l_text_focus_gc, screen().winFrameTheme().labelTextFocusGC(),
new_workspace_name.c_str(), l, new_workspace_name.c_str(), l,
x, dy); x, dy);
XDrawRectangle(display, frame.workspace_label.window(), XDrawRectangle(display, frame.workspace_label.window(),
screen().getWindowStyle()->l_text_focus_gc, x + tw, 0, 1, screen().winFrameTheme().labelTextFocusGC(),
x + tw, 0, 1,
frame.label_h - 1); frame.label_h - 1);
} }
} }
@ -1094,15 +1095,17 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
frame.y = head_y; frame.y = head_y;
frame.x_hidden = head_x; frame.x_hidden = head_x;
frame.y_hidden = head_y + frame.y_hidden = head_y +
screen().getBevelWidth() - screen().getBorderWidth() - frame.height; screen().rootTheme().bevelWidth() -
screen().rootTheme().borderWidth() - frame.height;
break; break;
case BOTTOMLEFT: case BOTTOMLEFT:
frame.x = head_x; frame.x = head_x;
frame.y = head_y + head_h - frame.height - screen().getBorderWidth2x(); frame.y = head_y + head_h - frame.height -
screen().rootTheme().borderWidth()*2;
frame.x_hidden = head_x; frame.x_hidden = head_x;
frame.y_hidden = head_y + head_h - screen().getBevelWidth() - frame.y_hidden = head_y + head_h - screen().rootTheme().bevelWidth() -
screen().getBorderWidth(); screen().rootTheme().borderWidth();
break; break;
case TOPCENTER: case TOPCENTER:
@ -1110,70 +1113,73 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
frame.y = head_y; frame.y = head_y;
frame.x_hidden = frame.x; frame.x_hidden = frame.x;
frame.y_hidden = head_y + frame.y_hidden = head_y +
screen().getBevelWidth() - screen().getBorderWidth() - frame.height; screen().rootTheme().bevelWidth() -
screen().rootTheme().borderWidth() - frame.height;
break; break;
case TOPRIGHT: case TOPRIGHT:
frame.x = head_x + head_w - frame.width - screen().getBorderWidth2x(); frame.x = head_x + head_w - frame.width - screen().rootTheme().borderWidth()*2;
frame.y = head_y; frame.y = head_y;
frame.x_hidden = frame.x; frame.x_hidden = frame.x;
break; break;
case BOTTOMRIGHT: case BOTTOMRIGHT:
frame.x = head_x + head_w - frame.width - screen().getBorderWidth2x(); frame.x = head_x + head_w - frame.width -
frame.y = head_y + head_h - frame.height - screen().getBorderWidth2x(); screen().rootTheme().borderWidth()*2;
frame.y = head_y + head_h - frame.height -
screen().rootTheme().borderWidth()*2;
frame.x_hidden = frame.x; frame.x_hidden = frame.x;
frame.y_hidden = head_y + head_h - screen().getBevelWidth() - frame.y_hidden = head_y + head_h - screen().rootTheme().bevelWidth() -
screen().getBorderWidth(); screen().rootTheme().borderWidth();
break; break;
case BOTTOMCENTER: // default is BOTTOMCENTER case BOTTOMCENTER: // default is BOTTOMCENTER
default: default:
frame.x = head_x + (head_w - frame.width) / 2; frame.x = head_x + (head_w - frame.width) / 2;
frame.y = head_y + head_h - frame.height - screen().getBorderWidth2x(); frame.y = head_y + head_h - frame.height - screen().rootTheme().borderWidth()*2;
frame.x_hidden = frame.x; frame.x_hidden = frame.x;
frame.y_hidden = head_y + head_h - screen().getBevelWidth() - frame.y_hidden = head_y + head_h - screen().rootTheme().bevelWidth() -
screen().getBorderWidth(); screen().rootTheme().borderWidth();
break; break;
case LEFTCENTER: case LEFTCENTER:
frame.x = head_x; frame.x = head_x;
frame.y = head_y + (head_h - frame.height)/2; frame.y = head_y + (head_h - frame.height)/2;
frame.x_hidden = frame.x - frame.width + frame.x_hidden = frame.x - frame.width +
screen().getBevelWidth() + screen().getBorderWidth(); screen().rootTheme().bevelWidth() + screen().rootTheme().borderWidth();
frame.y_hidden = frame.y; frame.y_hidden = frame.y;
break; break;
case LEFTTOP: case LEFTTOP:
frame.x = head_x; frame.x = head_x;
frame.y = head_y; frame.y = head_y;
frame.x_hidden = frame.x - frame.width + frame.x_hidden = frame.x - frame.width +
screen().getBevelWidth() + screen().getBorderWidth(); screen().rootTheme().bevelWidth() + screen().rootTheme().borderWidth();
frame.y_hidden = frame.y; frame.y_hidden = frame.y;
break; break;
case LEFTBOTTOM: case LEFTBOTTOM:
frame.x = head_x; frame.x = head_x;
frame.y = head_y + head_h - frame.height; frame.y = head_y + head_h - frame.height;
frame.x_hidden = frame.x - frame.width + frame.x_hidden = frame.x - frame.width +
screen().getBevelWidth() + screen().getBorderWidth(); screen().rootTheme().bevelWidth() + screen().rootTheme().borderWidth();
frame.y_hidden = frame.y; frame.y_hidden = frame.y;
break; break;
case RIGHTCENTER: case RIGHTCENTER:
frame.x = head_x + head_w - frame.width; frame.x = head_x + head_w - frame.width;
frame.y = head_y + (head_h - frame.height)/2; frame.y = head_y + (head_h - frame.height)/2;
frame.x_hidden = frame.x + frame.width - frame.x_hidden = frame.x + frame.width -
screen().getBevelWidth() - screen().getBorderWidth(); screen().rootTheme().bevelWidth() - screen().rootTheme().borderWidth();
frame.y_hidden = frame.y; frame.y_hidden = frame.y;
break; break;
case RIGHTTOP: case RIGHTTOP:
frame.x = head_x + head_w - frame.width; frame.x = head_x + head_w - frame.width;
frame.y = head_y; frame.y = head_y;
frame.x_hidden = frame.x + frame.width - frame.x_hidden = frame.x + frame.width -
screen().getBevelWidth() - screen().getBorderWidth(); screen().rootTheme().bevelWidth() - screen().rootTheme().borderWidth();
frame.y_hidden = frame.y; frame.y_hidden = frame.y;
break; break;
case RIGHTBOTTOM: case RIGHTBOTTOM:
frame.x = head_x + head_w - frame.width; frame.x = head_x + head_w - frame.width;
frame.y = head_y + head_h - frame.height; frame.y = head_y + head_h - frame.height;
frame.x_hidden = frame.x + frame.width - frame.x_hidden = frame.x + frame.width -
screen().getBevelWidth() - screen().getBorderWidth(); screen().rootTheme().bevelWidth() - screen().rootTheme().borderWidth();
frame.y_hidden = frame.y; frame.y_hidden = frame.y;
break; break;
} }