linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #04177
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2536: draw splitters with the window title bar color
------------------------------------------------------------
revno: 2536
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2011-05-27 20:05:51 +0200
message:
draw splitters with the window title bar color
modified:
dwt/include/dwt/dwt_vsstyle.h
dwt/src/widgets/Splitter.cpp
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dwt/include/dwt/dwt_vsstyle.h'
--- dwt/include/dwt/dwt_vsstyle.h 2011-02-20 16:20:37 +0000
+++ dwt/include/dwt/dwt_vsstyle.h 2011-05-27 18:05:51 +0000
@@ -59,20 +59,17 @@
#define MPI_DISABLED 3
#define MPI_DISABLEDHOT 4
-#define VSCLASS_PROGRESS L"PROGRESS"
-#define PP_BAR 1
-#define PP_BARVERT 2
-#define PP_FILL 5
-#define PP_FILLVERT 6
-#define PBFS_NORMAL 1
-#define PBFVS_NORMAL 1
-
#define VSCLASS_TAB L"TAB"
#define TABP_TABITEM 1
#define TIS_NORMAL 1
#define TIS_HOT 2
#define TIS_SELECTED 3
+#define VSCLASS_WINDOW L"WINDOW"
+#define WP_CAPTION 1
+#define CS_ACTIVE 1
+#define CS_INACTIVE 2
+
#else
#include <vsstyle.h>
#endif
=== modified file 'dwt/src/widgets/Splitter.cpp'
--- dwt/src/widgets/Splitter.cpp 2011-04-24 20:52:25 +0000
+++ dwt/src/widgets/Splitter.cpp 2011-05-27 18:05:51 +0000
@@ -45,7 +45,7 @@
horizontal = cs.horizontal;
BaseType::create(cs);
- theme.load(VSCLASS_PROGRESS, this);
+ theme.load(VSCLASS_WINDOW, this);
onPainting([this](PaintCanvas& canvas) { GCC_WTF->handlePainting(canvas); });
onLeftMouseDown([this](const MouseEvent&) { return GCC_WTF->handleLButtonDown(); });
@@ -61,21 +61,12 @@
void Splitter::handlePainting(PaintCanvas& canvas) {
if(theme) {
- int part, state;
- if(hovering) {
- part = horizontal ? PP_FILL : PP_FILLVERT;
- state = horizontal ? PBFS_NORMAL : PBFVS_NORMAL;
- } else {
- part = horizontal ? PP_BAR : PP_BARVERT;
- state = 0;
- }
-
// don't draw edges.
Rectangle rect(canvas.getPaintRect());
(horizontal ? rect.pos.x : rect.pos.y) -= 2;
(horizontal ? rect.size.x : rect.size.y) += 4;
- theme.drawBackground(canvas, part, state, rect);
+ theme.drawBackground(canvas, WP_CAPTION, hovering ? CS_ACTIVE : CS_INACTIVE, rect);
} else if(hovering) {
// safe to assume that the text color is different enough from the default background.