linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #01684
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2198: draw unthemed tabs better
------------------------------------------------------------
revno: 2198
committer: poy <poy@xxxxxxxxxx>
branch nick: repo
timestamp: Sat 2010-08-07 22:36:06 +0200
message:
draw unthemed tabs better
modified:
dwt/src/widgets/TabView.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/src/widgets/TabView.cpp'
--- dwt/src/widgets/TabView.cpp 2010-08-07 16:35:11 +0000
+++ dwt/src/widgets/TabView.cpp 2010-08-07 20:36:06 +0000
@@ -100,10 +100,10 @@
loadTheme(VSCLASS_TAB);
- // in button-style, use classic owner-draw callbacks; in tab style, fully take over painting.
- if(cs.style & TCS_BUTTONS) {
+ if(!theme || (cs.style & TCS_BUTTONS)) {
dwtassert(dynamic_cast<Control*>(getParent()), _T("Owner-drawn tabs must have a parent derived from dwt::Control"));
} else {
+ // we don't want pre-drawn borders to get in the way here, so we fully take over painting.
onPainting(std::bind((void (TabView::*)(PaintCanvas&))(&TabView::handlePainting), this, _1));
}
@@ -665,7 +665,7 @@
canvas.fill(rect, Brush(isSelected ? Brush::Window : isHighlighted ? Brush::HighLight : Brush::BtnFace));
}
- if(isSelected && !hasStyle(TCS_BUTTONS)) {
+ if(isSelected && theme && !hasStyle(TCS_BUTTONS)) {
rect.pos.y += 1;
rect.size.y -= 1;
}