aboutsummaryrefslogtreecommitdiff
path: root/src/Toolbar.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2009-07-24 07:56:04 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2009-07-24 07:56:04 (GMT)
commit9dcbff31b492ca4277471accc95696e0f9a0dd20 (patch)
tree36d4d1b107c434f49706b18f4af7aa4485282a2d /src/Toolbar.cc
parent589125672b684f18fbfb81dddb3a3fe45c857516 (diff)
downloadfluxbox_pavel-9dcbff31b492ca4277471accc95696e0f9a0dd20.zip
fluxbox_pavel-9dcbff31b492ca4277471accc95696e0f9a0dd20.tar.bz2
make autohide only show the border or 1 pixel if borderless
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r--src/Toolbar.cc33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 2552de9..dbe5e5c 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -391,6 +391,8 @@ void Toolbar::reconfigure() {
391 391
392 updateVisibleState(); 392 updateVisibleState();
393 393
394 if (doAutoHide() && !isHidden() && !m_hide_timer.isTiming())
395 m_hide_timer.start();
394 if (!doAutoHide() && isHidden()) 396 if (!doAutoHide() && isHidden())
395 toggleHidden(); 397 toggleHidden();
396 398
@@ -457,9 +459,6 @@ void Toolbar::reconfigure() {
457 menu().reconfigure(); 459 menu().reconfigure();
458 } 460 }
459 461
460 if (doAutoHide())
461 m_hide_timer.start();
462
463 frame.bevel_w = theme()->bevelWidth(); 462 frame.bevel_w = theme()->bevelWidth();
464 // destroy shape if the theme wasn't specified with one, 463 // destroy shape if the theme wasn't specified with one,
465 // or create one 464 // or create one
@@ -655,7 +654,6 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
655 head_h = screen().getHeadHeight(head); 654 head_h = screen().getHeadHeight(head);
656 } 655 }
657 656
658 int bevel_width = theme()->bevelWidth();
659 int border_width = theme()->border().width(); 657 int border_width = theme()->border().width();
660 658
661 frame.width = (head_w - 2*border_width) * (*m_rc_width_percent) / 100; 659 frame.width = (head_w - 2*border_width) * (*m_rc_width_percent) / 100;
@@ -682,8 +680,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
682 680
683 681
684 // So we get at least one pixel visible in hidden mode 682 // So we get at least one pixel visible in hidden mode
685 if (bevel_width <= border_width) 683 int pixel = (border_width == 0 ? 1 : 0);
686 bevel_width = border_width + 1;
687 684
688 FbTk::Orientation orient = FbTk::ROT0; 685 FbTk::Orientation orient = FbTk::ROT0;
689 686
@@ -692,7 +689,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
692 frame.x = head_x; 689 frame.x = head_x;
693 frame.y = head_y; 690 frame.y = head_y;
694 frame.x_hidden = head_x; 691 frame.x_hidden = head_x;
695 frame.y_hidden = head_y + bevel_width - border_width - frame.height; 692 frame.y_hidden = head_y - border_width - frame.height + pixel;
696 if (m_shape.get()) 693 if (m_shape.get())
697 m_shape->setPlaces(FbTk::Shape::BOTTOMRIGHT | FbTk::Shape::BOTTOMLEFT); 694 m_shape->setPlaces(FbTk::Shape::BOTTOMRIGHT | FbTk::Shape::BOTTOMLEFT);
698 break; 695 break;
@@ -701,7 +698,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
701 frame.x = head_x; 698 frame.x = head_x;
702 frame.y = head_y + head_h - frame.height - border_width*2; 699 frame.y = head_y + head_h - frame.height - border_width*2;
703 frame.x_hidden = head_x; 700 frame.x_hidden = head_x;
704 frame.y_hidden = head_y + head_h - bevel_width - border_width; 701 frame.y_hidden = head_y + head_h - border_width - pixel;
705 if (m_shape.get()) 702 if (m_shape.get())
706 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::TOPLEFT); 703 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::TOPLEFT);
707 break; 704 break;
@@ -710,7 +707,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
710 frame.x = head_x + (head_w - frame.width) / 2 - border_width; 707 frame.x = head_x + (head_w - frame.width) / 2 - border_width;
711 frame.y = head_y; 708 frame.y = head_y;
712 frame.x_hidden = frame.x; 709 frame.x_hidden = frame.x;
713 frame.y_hidden = head_y + bevel_width - border_width - frame.height; 710 frame.y_hidden = head_y - border_width - frame.height + pixel;
714 if (m_shape.get()) 711 if (m_shape.get())
715 m_shape->setPlaces(FbTk::Shape::BOTTOMRIGHT | FbTk::Shape::BOTTOMLEFT); 712 m_shape->setPlaces(FbTk::Shape::BOTTOMRIGHT | FbTk::Shape::BOTTOMLEFT);
716 break; 713 break;
@@ -718,7 +715,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
718 frame.x = head_x + head_w - frame.width - border_width*2; 715 frame.x = head_x + head_w - frame.width - border_width*2;
719 frame.y = head_y; 716 frame.y = head_y;
720 frame.x_hidden = frame.x; 717 frame.x_hidden = frame.x;
721 frame.y_hidden = head_y + bevel_width - border_width - frame.height; 718 frame.y_hidden = head_y - border_width - frame.height + pixel;
722 if (m_shape.get()) 719 if (m_shape.get())
723 m_shape->setPlaces(FbTk::Shape::BOTTOMRIGHT | FbTk::Shape::BOTTOMLEFT); 720 m_shape->setPlaces(FbTk::Shape::BOTTOMRIGHT | FbTk::Shape::BOTTOMLEFT);
724 break; 721 break;
@@ -727,7 +724,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
727 frame.x = head_x + head_w - frame.width - border_width*2; 724 frame.x = head_x + head_w - frame.width - border_width*2;
728 frame.y = head_y + head_h - frame.height - border_width*2; 725 frame.y = head_y + head_h - frame.height - border_width*2;
729 frame.x_hidden = frame.x; 726 frame.x_hidden = frame.x;
730 frame.y_hidden = head_y + head_h - bevel_width - border_width; 727 frame.y_hidden = head_y + head_h - border_width - pixel;
731 if (m_shape.get()) 728 if (m_shape.get())
732 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::TOPLEFT); 729 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::TOPLEFT);
733 break; 730 break;
@@ -736,7 +733,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
736 frame.x = head_x + (head_w - frame.width) / 2 - border_width; 733 frame.x = head_x + (head_w - frame.width) / 2 - border_width;
737 frame.y = head_y + head_h - frame.height - border_width*2; 734 frame.y = head_y + head_h - frame.height - border_width*2;
738 frame.x_hidden = frame.x; 735 frame.x_hidden = frame.x;
739 frame.y_hidden = head_y + head_h - bevel_width - border_width; 736 frame.y_hidden = head_y + head_h - border_width - pixel;
740 if (m_shape.get()) 737 if (m_shape.get())
741 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::TOPLEFT); 738 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::TOPLEFT);
742 break; 739 break;
@@ -744,7 +741,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
744 orient = FbTk::ROT270; 741 orient = FbTk::ROT270;
745 frame.x = head_x; 742 frame.x = head_x;
746 frame.y = head_y + (head_h - frame.height)/2 - border_width; 743 frame.y = head_y + (head_h - frame.height)/2 - border_width;
747 frame.x_hidden = frame.x - frame.width + bevel_width + border_width; 744 frame.x_hidden = frame.x - frame.width - border_width + pixel;
748 frame.y_hidden = frame.y; 745 frame.y_hidden = frame.y;
749 if (m_shape.get()) 746 if (m_shape.get())
750 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::BOTTOMRIGHT); 747 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::BOTTOMRIGHT);
@@ -753,7 +750,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
753 orient = FbTk::ROT270; 750 orient = FbTk::ROT270;
754 frame.x = head_x; 751 frame.x = head_x;
755 frame.y = head_y; 752 frame.y = head_y;
756 frame.x_hidden = frame.x - frame.width + bevel_width + border_width; 753 frame.x_hidden = frame.x - frame.width - border_width + pixel;
757 frame.y_hidden = frame.y; 754 frame.y_hidden = frame.y;
758 if (m_shape.get()) 755 if (m_shape.get())
759 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::BOTTOMRIGHT); 756 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::BOTTOMRIGHT);
@@ -762,7 +759,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
762 orient = FbTk::ROT270; 759 orient = FbTk::ROT270;
763 frame.x = head_x; 760 frame.x = head_x;
764 frame.y = head_y + head_h - frame.height - border_width*2; 761 frame.y = head_y + head_h - frame.height - border_width*2;
765 frame.x_hidden = frame.x - frame.width + bevel_width + border_width; 762 frame.x_hidden = frame.x - frame.width - border_width + pixel;
766 frame.y_hidden = frame.y; 763 frame.y_hidden = frame.y;
767 if (m_shape.get()) 764 if (m_shape.get())
768 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::BOTTOMRIGHT); 765 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::BOTTOMRIGHT);
@@ -771,7 +768,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
771 orient = FbTk::ROT90; 768 orient = FbTk::ROT90;
772 frame.x = head_x + head_w - frame.width - border_width*2; 769 frame.x = head_x + head_w - frame.width - border_width*2;
773 frame.y = head_y + (head_h - frame.height)/2 - border_width; 770 frame.y = head_y + (head_h - frame.height)/2 - border_width;
774 frame.x_hidden = frame.x + frame.width - bevel_width - border_width; 771 frame.x_hidden = frame.x + frame.width + border_width - pixel;
775 frame.y_hidden = frame.y; 772 frame.y_hidden = frame.y;
776 if (m_shape.get()) 773 if (m_shape.get())
777 m_shape->setPlaces(FbTk::Shape::TOPLEFT | FbTk::Shape::BOTTOMLEFT); 774 m_shape->setPlaces(FbTk::Shape::TOPLEFT | FbTk::Shape::BOTTOMLEFT);
@@ -780,7 +777,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
780 orient = FbTk::ROT90; 777 orient = FbTk::ROT90;
781 frame.x = head_x + head_w - frame.width - border_width*2; 778 frame.x = head_x + head_w - frame.width - border_width*2;
782 frame.y = head_y; 779 frame.y = head_y;
783 frame.x_hidden = frame.x + frame.width - bevel_width - border_width; 780 frame.x_hidden = frame.x + frame.width + border_width - pixel;
784 frame.y_hidden = frame.y; 781 frame.y_hidden = frame.y;
785 if (m_shape.get()) 782 if (m_shape.get())
786 m_shape->setPlaces(FbTk::Shape::TOPLEFT | FbTk::Shape::BOTTOMLEFT); 783 m_shape->setPlaces(FbTk::Shape::TOPLEFT | FbTk::Shape::BOTTOMLEFT);
@@ -789,7 +786,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
789 orient = FbTk::ROT90; 786 orient = FbTk::ROT90;
790 frame.x = head_x + head_w - frame.width - border_width*2; 787 frame.x = head_x + head_w - frame.width - border_width*2;
791 frame.y = head_y + head_h - frame.height - border_width*2; 788 frame.y = head_y + head_h - frame.height - border_width*2;
792 frame.x_hidden = frame.x + frame.width - bevel_width - border_width; 789 frame.x_hidden = frame.x + frame.width + border_width - pixel;
793 frame.y_hidden = frame.y; 790 frame.y_hidden = frame.y;
794 if (m_shape.get()) 791 if (m_shape.get())
795 m_shape->setPlaces(FbTk::Shape::TOPLEFT | FbTk::Shape::BOTTOMLEFT); 792 m_shape->setPlaces(FbTk::Shape::TOPLEFT | FbTk::Shape::BOTTOMLEFT);