aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-04-28 16:48:23 (GMT)
committerrathnor <rathnor>2003-04-28 16:48:23 (GMT)
commit41c0ea543c68b54fd4eef78a773d8d8d179963fd (patch)
treead8722243209922cabd0c82d8a6d3f0f55e80d75
parent1ce64cab597cd9bb45b29c9a403db908b9cf2cdb (diff)
downloadfluxbox-41c0ea543c68b54fd4eef78a773d8d8d179963fd.zip
fluxbox-41c0ea543c68b54fd4eef78a773d8d8d179963fd.tar.bz2
toolbar size + alignment fixes
-rw-r--r--ChangeLog3
-rw-r--r--src/IconBar.cc7
-rw-r--r--src/Toolbar.cc56
3 files changed, 48 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 536e3a0..e5975e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
1(Format: Year/Month/Day) 1(Format: Year/Month/Day)
2Changes for 0.9.2: 2Changes for 0.9.2:
3*03/04/28: 3*03/04/28:
4 * Fix a bunch of alignment + size issues with toolbar (particularly
5 when vertical) (Simon)
6 Toolbar.cc Iconbar.cc
4 * Fix remembering (and general init) of decorations (Simon) 7 * Fix remembering (and general init) of decorations (Simon)
5 Window.hh/cc 8 Window.hh/cc
6 * Fix handleEvent issues, plus detachClient crash (Simon) 9 * Fix handleEvent issues, plus detachClient crash (Simon)
diff --git a/src/IconBar.cc b/src/IconBar.cc
index 5de8558..8e28f2a 100644
--- a/src/IconBar.cc
+++ b/src/IconBar.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: IconBar.cc,v 1.31 2003/04/25 10:40:31 fluxgen Exp $ 22// $Id: IconBar.cc,v 1.32 2003/04/28 16:48:22 rathnor Exp $
23 23
24#include "IconBar.hh" 24#include "IconBar.hh"
25 25
@@ -339,8 +339,9 @@ void IconBar::draw(const IconBarObj * const obj, int width) const {
339 if (m_vertical) { 339 if (m_vertical) {
340 int tmp = dy; 340 int tmp = dy;
341 dy = obj->height() - dx; 341 dy = obj->height() - dx;
342 dx = tmp; 342 dx = tmp + bevel_w;
343 } 343 } else
344 dy += bevel_w;
344 345
345 m_font.drawText( 346 m_font.drawText(
346 iconwin, 347 iconwin,
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 349f1ea..541bdea 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.76 2003/04/27 04:28:03 rathnor Exp $ 25// $Id: Toolbar.cc,v 1.77 2003/04/28 16:48:23 rathnor Exp $
26 26
27#include "Toolbar.hh" 27#include "Toolbar.hh"
28 28
@@ -462,10 +462,27 @@ void Toolbar::reconfigure() {
462 else if (frame.workspace_label_w > frame.clock_w) 462 else if (frame.workspace_label_w > frame.clock_w)
463 frame.clock_w = frame.workspace_label_w; 463 frame.clock_w = frame.workspace_label_w;
464 464
465 frame.window_label_w = 465 // Right, let's break this one down....
466 (frame.width - (frame.clock_w + (frame.button_w * 4) + 466 // full width, minus clock, workspace label and the 4 arrow buttons.
467 frame.workspace_label_w + (frame.bevel_w * 8) + 6)); 467 // each of the (6) aforementioned items are separated by a bevel width,
468 468 // plus outside (+1), plus the window label (+1).
469
470 i = frame.clock_w + (frame.button_w * 4) +
471 frame.workspace_label_w + (frame.bevel_w * 8) + 6;
472
473 // of course if your toolbar is set too small, this could go negative.
474 // which is bad mmmkay. Since we are unsigned, we check that *first*.
475 if (vertical)
476 w = frame.height;
477 else
478 w = frame.width;
479
480 if (i > w)
481 frame.window_label_w = 0;
482 else
483 frame.window_label_w = w - i;
484
485
469 if (hidden) 486 if (hidden)
470 frame.window.moveResize(frame.x_hidden, frame.y_hidden, 487 frame.window.moveResize(frame.x_hidden, frame.y_hidden,
471 frame.width, frame.height); 488 frame.width, frame.height);
@@ -477,6 +494,12 @@ void Toolbar::reconfigure() {
477 494
478 unsigned int next_x = frame.workspace_label_w; 495 unsigned int next_x = frame.workspace_label_w;
479 unsigned int next_y = frame.window.height(); 496 unsigned int next_y = frame.window.height();
497 unsigned int text_x=0, text_y=0;
498 if (vertical)
499 text_x = frame.bevel_w;
500 else
501 text_y = frame.bevel_w;
502
480 503
481 if (vertical) { 504 if (vertical) {
482 next_x = frame.window.width(); 505 next_x = frame.window.width();
@@ -507,12 +530,11 @@ void Toolbar::reconfigure() {
507 if (vertical) { 530 if (vertical) {
508 next_y += frame.nsbutton.height() + 1; 531 next_y += frame.nsbutton.height() + 1;
509 label_w = frame.width; 532 label_w = frame.width;
510 label_h = frame.window_label_w - frame.width + frame.height; 533 label_h = frame.window_label_w/* - frame.width + frame.height*/;
511 534
512 } else 535 } else
513 next_x += frame.nsbutton.width() + 1; 536 next_x += frame.nsbutton.width() + 1;
514 537
515
516 frame.window_label.moveResize(next_x, next_y, 538 frame.window_label.moveResize(next_x, next_y,
517 label_w, label_h); 539 label_w, label_h);
518 if (vertical) 540 if (vertical)
@@ -538,7 +560,7 @@ void Toolbar::reconfigure() {
538 } else 560 } else
539 next_x += frame.nwbutton.width() + 1; 561 next_x += frame.nwbutton.width() + 1;
540 562
541 frame.clock.moveResize(next_x, next_y, 563 frame.clock.moveResize(next_x + text_x, next_y + text_y,
542 clock_w, clock_h); 564 clock_w, clock_h);
543 565
544 Pixmap tmp = frame.base; 566 Pixmap tmp = frame.base;
@@ -650,6 +672,9 @@ void Toolbar::reconfigure() {
650 frame.nwbutton.clear(); 672 frame.nwbutton.clear();
651 673
652 redrawWindowLabel(); 674 redrawWindowLabel();
675 if (m_iconbar.get())
676 m_iconbar->reconfigure();
677
653 redrawWorkspaceLabel(); 678 redrawWorkspaceLabel();
654 checkClock(true); 679 checkClock(true);
655 680
@@ -775,8 +800,9 @@ void Toolbar::redrawWindowLabel(bool redraw) {
775 if (m_theme.font().isRotated()) { 800 if (m_theme.font().isRotated()) {
776 int tmp = dy; 801 int tmp = dy;
777 dy = frame.window_label.height() - dx; 802 dy = frame.window_label.height() - dx;
778 dx = tmp; 803 dx = tmp + frame.bevel_w;
779 } 804 } else
805 dy += frame.bevel_w;
780 806
781 m_theme.font().drawText( 807 m_theme.font().drawText(
782 frame.window_label.window(), 808 frame.window_label.window(),
@@ -1151,28 +1177,28 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
1151 break; 1177 break;
1152 case LEFTBOTTOM: 1178 case LEFTBOTTOM:
1153 frame.x = head_x; 1179 frame.x = head_x;
1154 frame.y = head_y + head_h - frame.height; 1180 frame.y = head_y + head_h - frame.height - screen().rootTheme().borderWidth()*2;
1155 frame.x_hidden = frame.x - frame.width + 1181 frame.x_hidden = frame.x - frame.width +
1156 screen().rootTheme().bevelWidth() + screen().rootTheme().borderWidth(); 1182 screen().rootTheme().bevelWidth() + screen().rootTheme().borderWidth();
1157 frame.y_hidden = frame.y; 1183 frame.y_hidden = frame.y;
1158 break; 1184 break;
1159 case RIGHTCENTER: 1185 case RIGHTCENTER:
1160 frame.x = head_x + head_w - frame.width; 1186 frame.x = head_x + head_w - frame.width - screen().rootTheme().borderWidth()*2;
1161 frame.y = head_y + (head_h - frame.height)/2; 1187 frame.y = head_y + (head_h - frame.height)/2;
1162 frame.x_hidden = frame.x + frame.width - 1188 frame.x_hidden = frame.x + frame.width -
1163 screen().rootTheme().bevelWidth() - screen().rootTheme().borderWidth(); 1189 screen().rootTheme().bevelWidth() - screen().rootTheme().borderWidth();
1164 frame.y_hidden = frame.y; 1190 frame.y_hidden = frame.y;
1165 break; 1191 break;
1166 case RIGHTTOP: 1192 case RIGHTTOP:
1167 frame.x = head_x + head_w - frame.width; 1193 frame.x = head_x + head_w - frame.width - screen().rootTheme().borderWidth()*2;
1168 frame.y = head_y; 1194 frame.y = head_y;
1169 frame.x_hidden = frame.x + frame.width - 1195 frame.x_hidden = frame.x + frame.width -
1170 screen().rootTheme().bevelWidth() - screen().rootTheme().borderWidth(); 1196 screen().rootTheme().bevelWidth() - screen().rootTheme().borderWidth();
1171 frame.y_hidden = frame.y; 1197 frame.y_hidden = frame.y;
1172 break; 1198 break;
1173 case RIGHTBOTTOM: 1199 case RIGHTBOTTOM:
1174 frame.x = head_x + head_w - frame.width; 1200 frame.x = head_x + head_w - frame.width - screen().rootTheme().borderWidth()*2;
1175 frame.y = head_y + head_h - frame.height; 1201 frame.y = head_y + head_h - frame.height - screen().rootTheme().borderWidth()*2;
1176 frame.x_hidden = frame.x + frame.width - 1202 frame.x_hidden = frame.x + frame.width -
1177 screen().rootTheme().bevelWidth() - screen().rootTheme().borderWidth(); 1203 screen().rootTheme().bevelWidth() - screen().rootTheme().borderWidth();
1178 frame.y_hidden = frame.y; 1204 frame.y_hidden = frame.y;