Additional scrollbar fixes

pull/1/head
Timothy Pearson 12 years ago
parent b358b8dfae
commit 98eb5b995a

@ -415,7 +415,7 @@ void gtkScrollbarToScrollbarCeData(GtkScrollbar* scrollbarWidget, TQStyleControl
// Convert the GTK slider length into a correct pagestep that TQt3 can use to obtain the same slider length value
bool threeButtonScrollBar = false;
if (m_scrollbarBack2 | m_scrollbarForward2) threeButtonScrollBar = true;
if (m_scrollbarForward1 | m_scrollbarBack2) threeButtonScrollBar = true;
TQStyle::ControlElementFlags elementFlags = TQStyle::CEF_None;
int gtkSliderLength = slider_end_pos - slider_start_pos;
uint range = ceData.maxSteps - ceData.minSteps;
@ -696,6 +696,17 @@ draw_scrollbar_frame(DRAW_ARGS, const GtkWidgetPath* path, GtkStateFlags state,
first = tqApp->style().querySubControlMetrics(TQStyle::CC_ScrollBar, ceData, elementFlags, TQStyle::SC_ScrollBarFirst);
last = tqApp->style().querySubControlMetrics(TQStyle::CC_ScrollBar, ceData, elementFlags, TQStyle::SC_ScrollBarLast);
bool threeButtonScrollBar = false;
if (m_scrollbarForward1 | m_scrollbarBack2) threeButtonScrollBar = true;
if (threeButtonScrollBar) {
if (ceData.orientation == TQt::Horizontal) {
addline = TQRect(allocation.width-(subline.width()*2), subline.y(), subline.width()*2, subline.height());
}
else {
addline = TQRect(subline.x(), allocation.height-(subline.height()*2), subline.width(), subline.height()*2);
}
}
// HACK
// This may not be 100% reliable!
GdkModifierType mouseStateFlags;
@ -703,7 +714,6 @@ draw_scrollbar_frame(DRAW_ARGS, const GtkWidgetPath* path, GtkStateFlags state,
bool mousedown = (mouseStateFlags & GDK_BUTTON1_MASK);
if (mousedown) {
bool combine_addlineregion_drawing_areas = tqApp->style().styleHint(TQStyle::SH_ScrollBar_CombineAddLineRegionDrawingAreas);
if (lastSliderActiveSubControl != TQStyle::SC_None) {
activeSubControl = (TQStyle::SubControl)(activeSubControl | lastSliderActiveSubControl);
}
@ -713,6 +723,7 @@ draw_scrollbar_frame(DRAW_ARGS, const GtkWidgetPath* path, GtkStateFlags state,
lastSliderActiveSubControl = TQStyle::SC_ScrollBarSubLine;
}
else if (addline.contains(cursor_pos)) {
if (threeButtonScrollBar) {
// Not so fast...the addline region may contain a subline control!
TQRect internalSubLine;
if (ceData.orientation == TQt::Horizontal) {
@ -730,6 +741,11 @@ draw_scrollbar_frame(DRAW_ARGS, const GtkWidgetPath* path, GtkStateFlags state,
lastSliderActiveSubControl = TQStyle::SC_ScrollBarAddLine;
}
}
else {
activeSubControl = (TQStyle::SubControl)(activeSubControl | TQStyle::SC_ScrollBarAddLine);
lastSliderActiveSubControl = TQStyle::SC_ScrollBarAddLine;
}
}
else if (subpage.contains(cursor_pos)) {
activeSubControl = (TQStyle::SubControl)(activeSubControl | TQStyle::SC_ScrollBarSubPage);
lastSliderActiveSubControl = TQStyle::SC_ScrollBarSubPage;

Loading…
Cancel
Save