aboutsummaryrefslogtreecommitdiff
path: root/src/Toolbar.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r--src/Toolbar.cc31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 0b52702..60a958c 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -54,6 +54,7 @@
54#include "FbTk/Transparent.hh" 54#include "FbTk/Transparent.hh"
55#include "FbTk/BoolMenuItem.hh" 55#include "FbTk/BoolMenuItem.hh"
56#include "FbTk/IntMenuItem.hh" 56#include "FbTk/IntMenuItem.hh"
57#include "FbTk/Shape.hh"
57 58
58 59
59// use GNU extensions 60// use GNU extensions
@@ -65,8 +66,6 @@
65#include "config.h" 66#include "config.h"
66#endif // HAVE_CONFIG_H 67#endif // HAVE_CONFIG_H
67 68
68#include "Shape.hh"
69
70#include <X11/Xutil.h> 69#include <X11/Xutil.h>
71#include <X11/keysym.h> 70#include <X11/keysym.h>
72 71
@@ -240,7 +239,7 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width):
240 m_rc_height(scrn.resourceManager(), 0, scrn.name() + ".toolbar.height", scrn.altName() + ".Toolbar.Height"), 239 m_rc_height(scrn.resourceManager(), 0, scrn.name() + ".toolbar.height", scrn.altName() + ".Toolbar.Height"),
241 m_rc_tools(scrn.resourceManager(), "workspacename, prevworkspace, nextworkspace, iconbar, systemtray, prevwindow, nextwindow, clock", 240 m_rc_tools(scrn.resourceManager(), "workspacename, prevworkspace, nextworkspace, iconbar, systemtray, prevwindow, nextwindow, clock",
242 scrn.name() + ".toolbar.tools", scrn.altName() + ".Toolbar.Tools"), 241 scrn.name() + ".toolbar.tools", scrn.altName() + ".Toolbar.Tools"),
243 m_shape(new Shape(frame.window, 0)), 242 m_shape(new FbTk::Shape(frame.window, 0)),
244 m_resize_lock(false) { 243 m_resize_lock(false) {
245 _FB_USES_NLS; 244 _FB_USES_NLS;
246 // we need to get notified when the theme is reloaded 245 // we need to get notified when the theme is reloaded
@@ -451,7 +450,7 @@ void Toolbar::reconfigure() {
451 if (theme().shape() == false && m_shape.get()) 450 if (theme().shape() == false && m_shape.get())
452 m_shape.reset(0); 451 m_shape.reset(0);
453 else if (theme().shape() && m_shape.get() == 0) { 452 else if (theme().shape() && m_shape.get() == 0) {
454 m_shape.reset(new Shape(frame.window, 0)); 453 m_shape.reset(new FbTk::Shape(frame.window, 0));
455 } 454 }
456 455
457 // recalibrate size 456 // recalibrate size
@@ -679,7 +678,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
679 frame.x_hidden = head_x; 678 frame.x_hidden = head_x;
680 frame.y_hidden = head_y + bevel_width - border_width - frame.height; 679 frame.y_hidden = head_y + bevel_width - border_width - frame.height;
681 if (m_shape.get()) 680 if (m_shape.get())
682 m_shape->setPlaces(Shape::BOTTOMRIGHT | Shape::BOTTOMLEFT); 681 m_shape->setPlaces(FbTk::Shape::BOTTOMRIGHT | FbTk::Shape::BOTTOMLEFT);
683 break; 682 break;
684 683
685 case BOTTOMLEFT: 684 case BOTTOMLEFT:
@@ -688,7 +687,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
688 frame.x_hidden = head_x; 687 frame.x_hidden = head_x;
689 frame.y_hidden = head_y + head_h - bevel_width - border_width; 688 frame.y_hidden = head_y + head_h - bevel_width - border_width;
690 if (m_shape.get()) 689 if (m_shape.get())
691 m_shape->setPlaces(Shape::TOPRIGHT | Shape::TOPLEFT); 690 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::TOPLEFT);
692 break; 691 break;
693 692
694 case TOPCENTER: 693 case TOPCENTER:
@@ -697,7 +696,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
697 frame.x_hidden = frame.x; 696 frame.x_hidden = frame.x;
698 frame.y_hidden = head_y + bevel_width - border_width - frame.height; 697 frame.y_hidden = head_y + bevel_width - border_width - frame.height;
699 if (m_shape.get()) 698 if (m_shape.get())
700 m_shape->setPlaces(Shape::BOTTOMRIGHT | Shape::BOTTOMLEFT); 699 m_shape->setPlaces(FbTk::Shape::BOTTOMRIGHT | FbTk::Shape::BOTTOMLEFT);
701 break; 700 break;
702 case TOPRIGHT: 701 case TOPRIGHT:
703 frame.x = head_x + head_w - frame.width - border_width*2; 702 frame.x = head_x + head_w - frame.width - border_width*2;
@@ -705,7 +704,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
705 frame.x_hidden = frame.x; 704 frame.x_hidden = frame.x;
706 frame.y_hidden = head_y + bevel_width - border_width - frame.height; 705 frame.y_hidden = head_y + bevel_width - border_width - frame.height;
707 if (m_shape.get()) 706 if (m_shape.get())
708 m_shape->setPlaces(Shape::BOTTOMRIGHT | Shape::BOTTOMLEFT); 707 m_shape->setPlaces(FbTk::Shape::BOTTOMRIGHT | FbTk::Shape::BOTTOMLEFT);
709 break; 708 break;
710 709
711 case BOTTOMRIGHT: 710 case BOTTOMRIGHT:
@@ -714,7 +713,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
714 frame.x_hidden = frame.x; 713 frame.x_hidden = frame.x;
715 frame.y_hidden = head_y + head_h - bevel_width - border_width; 714 frame.y_hidden = head_y + head_h - bevel_width - border_width;
716 if (m_shape.get()) 715 if (m_shape.get())
717 m_shape->setPlaces(Shape::TOPRIGHT | Shape::TOPLEFT); 716 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::TOPLEFT);
718 break; 717 break;
719 718
720 case BOTTOMCENTER: // default is BOTTOMCENTER 719 case BOTTOMCENTER: // default is BOTTOMCENTER
@@ -723,7 +722,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
723 frame.x_hidden = frame.x; 722 frame.x_hidden = frame.x;
724 frame.y_hidden = head_y + head_h - bevel_width - border_width; 723 frame.y_hidden = head_y + head_h - bevel_width - border_width;
725 if (m_shape.get()) 724 if (m_shape.get())
726 m_shape->setPlaces(Shape::TOPRIGHT | Shape::TOPLEFT); 725 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::TOPLEFT);
727 break; 726 break;
728 case LEFTCENTER: 727 case LEFTCENTER:
729 orient = FbTk::ROT270; 728 orient = FbTk::ROT270;
@@ -732,7 +731,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
732 frame.x_hidden = frame.x - frame.width + bevel_width + border_width; 731 frame.x_hidden = frame.x - frame.width + bevel_width + border_width;
733 frame.y_hidden = frame.y; 732 frame.y_hidden = frame.y;
734 if (m_shape.get()) 733 if (m_shape.get())
735 m_shape->setPlaces(Shape::TOPRIGHT | Shape::BOTTOMRIGHT); 734 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::BOTTOMRIGHT);
736 break; 735 break;
737 case LEFTTOP: 736 case LEFTTOP:
738 orient = FbTk::ROT270; 737 orient = FbTk::ROT270;
@@ -741,7 +740,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
741 frame.x_hidden = frame.x - frame.width + bevel_width + border_width; 740 frame.x_hidden = frame.x - frame.width + bevel_width + border_width;
742 frame.y_hidden = frame.y; 741 frame.y_hidden = frame.y;
743 if (m_shape.get()) 742 if (m_shape.get())
744 m_shape->setPlaces(Shape::TOPRIGHT | Shape::BOTTOMRIGHT); 743 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::BOTTOMRIGHT);
745 break; 744 break;
746 case LEFTBOTTOM: 745 case LEFTBOTTOM:
747 orient = FbTk::ROT270; 746 orient = FbTk::ROT270;
@@ -750,7 +749,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
750 frame.x_hidden = frame.x - frame.width + bevel_width + border_width; 749 frame.x_hidden = frame.x - frame.width + bevel_width + border_width;
751 frame.y_hidden = frame.y; 750 frame.y_hidden = frame.y;
752 if (m_shape.get()) 751 if (m_shape.get())
753 m_shape->setPlaces(Shape::TOPRIGHT | Shape::BOTTOMRIGHT); 752 m_shape->setPlaces(FbTk::Shape::TOPRIGHT | FbTk::Shape::BOTTOMRIGHT);
754 break; 753 break;
755 case RIGHTCENTER: 754 case RIGHTCENTER:
756 orient = FbTk::ROT90; 755 orient = FbTk::ROT90;
@@ -759,7 +758,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
759 frame.x_hidden = frame.x + frame.width - bevel_width - border_width; 758 frame.x_hidden = frame.x + frame.width - bevel_width - border_width;
760 frame.y_hidden = frame.y; 759 frame.y_hidden = frame.y;
761 if (m_shape.get()) 760 if (m_shape.get())
762 m_shape->setPlaces(Shape::TOPLEFT | Shape::BOTTOMLEFT); 761 m_shape->setPlaces(FbTk::Shape::TOPLEFT | FbTk::Shape::BOTTOMLEFT);
763 break; 762 break;
764 case RIGHTTOP: 763 case RIGHTTOP:
765 orient = FbTk::ROT90; 764 orient = FbTk::ROT90;
@@ -768,7 +767,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
768 frame.x_hidden = frame.x + frame.width - bevel_width - border_width; 767 frame.x_hidden = frame.x + frame.width - bevel_width - border_width;
769 frame.y_hidden = frame.y; 768 frame.y_hidden = frame.y;
770 if (m_shape.get()) 769 if (m_shape.get())
771 m_shape->setPlaces(Shape::TOPLEFT | Shape::BOTTOMLEFT); 770 m_shape->setPlaces(FbTk::Shape::TOPLEFT | FbTk::Shape::BOTTOMLEFT);
772 break; 771 break;
773 case RIGHTBOTTOM: 772 case RIGHTBOTTOM:
774 orient = FbTk::ROT90; 773 orient = FbTk::ROT90;
@@ -777,7 +776,7 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
777 frame.x_hidden = frame.x + frame.width - bevel_width - border_width; 776 frame.x_hidden = frame.x + frame.width - bevel_width - border_width;
778 frame.y_hidden = frame.y; 777 frame.y_hidden = frame.y;
779 if (m_shape.get()) 778 if (m_shape.get())
780 m_shape->setPlaces(Shape::TOPLEFT | Shape::BOTTOMLEFT); 779 m_shape->setPlaces(FbTk::Shape::TOPLEFT | FbTk::Shape::BOTTOMLEFT);
781 break; 780 break;
782 } 781 }
783 782