Diffstat (limited to 'qt/qt-2.3.7.patch/qte237-lefthand.patch') (more/less context) (ignore whitespace changes)
-rw-r--r-- | qt/qt-2.3.7.patch/qte237-lefthand.patch | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/qt/qt-2.3.7.patch/qte237-lefthand.patch b/qt/qt-2.3.7.patch/qte237-lefthand.patch index 0a0cccf..1287430 100644 --- a/qt/qt-2.3.7.patch/qte237-lefthand.patch +++ b/qt/qt-2.3.7.patch/qte237-lefthand.patch | |||
@@ -1,96 +1,103 @@ | |||
1 | Backport of the LeftHand patch from Qt2.3.8 | ||
2 | |||
3 | Puts Scrollbar on the left for people using the right hand | ||
4 | to hold the devices | ||
5 | |||
6 | |||
7 | |||
1 | diff -u qt-2.3.7_orig/src/widgets/qscrollview.cpp qt-2.3.7/src/widgets/qscrollview.cpp | 8 | diff -u qt-2.3.7_orig/src/widgets/qscrollview.cpp qt-2.3.7/src/widgets/qscrollview.cpp |
2 | --- qt-2.3.7_orig/src/widgets/qscrollview.cpp2004-06-13 20:42:54.000000000 +0200 | 9 | --- qt-2.3.7_orig/src/widgets/qscrollview.cpp2004-06-13 20:42:54.000000000 +0200 |
3 | +++ qt-2.3.7/src/widgets/qscrollview.cpp2004-06-13 20:45:16.000000000 +0200 | 10 | +++ qt-2.3.7/src/widgets/qscrollview.cpp2004-06-13 20:45:16.000000000 +0200 |
4 | @@ -526,15 +526,16 @@ | 11 | @@ -526,15 +526,16 @@ |
5 | this, SLOT( doDragAutoScroll() ) ); | 12 | this, SLOT( doDragAutoScroll() ) ); |
6 | #endif | 13 | #endif |
7 | 14 | ||
8 | - connect( &d->hbar, SIGNAL( valueChanged( int ) ), | 15 | - connect( &d->hbar, SIGNAL( valueChanged( int ) ), |
9 | -this, SLOT( hslide( int ) ) ); | 16 | -this, SLOT( hslide( int ) ) ); |
10 | - connect( &d->vbar, SIGNAL( valueChanged( int ) ), | 17 | - connect( &d->vbar, SIGNAL( valueChanged( int ) ), |
11 | -this, SLOT( vslide( int ) ) ); | 18 | -this, SLOT( vslide( int ) ) ); |
12 | + connect( &d->hbar, SIGNAL( valueChanged(int) ), | 19 | + connect( &d->hbar, SIGNAL( valueChanged(int) ), |
13 | +this, SLOT( hslide(int) ) ); | 20 | +this, SLOT( hslide(int) ) ); |
14 | + connect( &d->vbar, SIGNAL( valueChanged(int) ), | 21 | + connect( &d->vbar, SIGNAL( valueChanged(int) ), |
15 | +this, SLOT( vslide(int) ) ); | 22 | +this, SLOT( vslide(int) ) ); |
16 | d->viewport.installEventFilter( this ); | 23 | d->viewport.installEventFilter( this ); |
17 | 24 | ||
18 | setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); | 25 | setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); |
19 | setLineWidth( style().defaultFrameWidth() ); | 26 | setLineWidth( style().defaultFrameWidth() ); |
20 | setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); | 27 | setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); |
21 | + | 28 | + |
22 | } | 29 | } |
23 | 30 | ||
24 | 31 | ||
25 | @@ -683,6 +684,11 @@ | 32 | @@ -683,6 +684,11 @@ |
26 | h-tmarg-bmarg - (showh ? hsbExt : 0) ); | 33 | h-tmarg-bmarg - (showh ? hsbExt : 0) ); |
27 | } | 34 | } |
28 | 35 | ||
29 | +/* | 36 | +/* |
30 | + The surrounding environment (or application, if there is no | 37 | + The surrounding environment (or application, if there is no |
31 | + environment, may set this. Requires Qt >= 2.3.8. | 38 | + environment, may set this. Requires Qt >= 2.3.8. |
32 | +*/ | 39 | +*/ |
33 | +bool qt_left_hand_scrollbars = FALSE; | 40 | +bool qt_left_hand_scrollbars = FALSE; |
34 | 41 | ||
35 | /*! | 42 | /*! |
36 | Updates scrollbars - all possibilities considered. You should never | 43 | Updates scrollbars - all possibilities considered. You should never |
37 | @@ -786,45 +792,50 @@ | 44 | @@ -786,45 +792,50 @@ |
38 | 45 | ||
39 | // Position the scrollbars, viewport, and corner widget. | 46 | // Position the scrollbars, viewport, and corner widget. |
40 | int bottom; | 47 | int bottom; |
41 | + int xoffset = ( qt_left_hand_scrollbars && ( showv || cornerWidget() ) ) ? vsbExt : 0; | 48 | + int xoffset = ( qt_left_hand_scrollbars && ( showv || cornerWidget() ) ) ? vsbExt : 0; |
42 | + int xpos = qt_left_hand_scrollbars ? 0 : w-vsbExt; | 49 | + int xpos = qt_left_hand_scrollbars ? 0 : w-vsbExt; |
43 | + xpos = (style() == WindowsStyle) && qt_left_hand_scrollbars ? xpos + fw : xpos - fw; | 50 | + xpos = (style() == WindowsStyle) && qt_left_hand_scrollbars ? xpos + fw : xpos - fw; |
44 | + int ypos = tmarg; | 51 | + int ypos = tmarg; |
45 | + ypos = (style() == WindowsStyle) ? ypos +fw : 0; | 52 | + ypos = (style() == WindowsStyle) ? ypos +fw : 0; |
46 | if ( showh ) { | 53 | if ( showh ) { |
47 | int right = ( showv || cornerWidget() ) ? w-vsbExt : w; | 54 | int right = ( showv || cornerWidget() ) ? w-vsbExt : w; |
48 | if ( style() == WindowsStyle ) | 55 | if ( style() == WindowsStyle ) |
49 | - setHBarGeometry(d->hbar, fw, h-hsbExt-fw, | 56 | - setHBarGeometry(d->hbar, fw, h-hsbExt-fw, |
50 | + setHBarGeometry(d->hbar, fw + xoffset , h-hsbExt-fw, | 57 | + setHBarGeometry(d->hbar, fw + xoffset , h-hsbExt-fw, |
51 | right-fw-fw, hsbExt ); | 58 | right-fw-fw, hsbExt ); |
52 | else | 59 | else |
53 | - setHBarGeometry(d->hbar, 0, h-hsbExt, right, | 60 | - setHBarGeometry(d->hbar, 0, h-hsbExt, right, |
54 | + setHBarGeometry(d->hbar, 0+ xoffset, h-hsbExt, right, | 61 | + setHBarGeometry(d->hbar, 0+ xoffset, h-hsbExt, right, |
55 | hsbExt ); | 62 | hsbExt ); |
56 | bottom=h-hsbExt; | 63 | bottom=h-hsbExt; |
57 | } else { | 64 | } else { |
58 | bottom=h; | 65 | bottom=h; |
59 | } | 66 | } |
60 | if ( showv ) { | 67 | if ( showv ) { |
61 | -clipper()->setGeometry( lmarg, tmarg, | 68 | -clipper()->setGeometry( lmarg, tmarg, |
62 | +clipper()->setGeometry( lmarg + xoffset, tmarg, | 69 | +clipper()->setGeometry( lmarg + xoffset, tmarg, |
63 | w-vsbExt-lmarg-rmarg, | 70 | w-vsbExt-lmarg-rmarg, |
64 | bottom-tmarg-bmarg ); | 71 | bottom-tmarg-bmarg ); |
65 | d->viewportResized( w-vsbExt-lmarg-rmarg, bottom-tmarg-bmarg ); | 72 | d->viewportResized( w-vsbExt-lmarg-rmarg, bottom-tmarg-bmarg ); |
66 | if ( style() == WindowsStyle ) | 73 | if ( style() == WindowsStyle ) |
67 | - changeFrameRect(QRect(0, 0, w, h) ); | 74 | - changeFrameRect(QRect(0, 0, w, h) ); |
68 | + changeFrameRect(QRect(xoffset, 0, w, h) ); | 75 | + changeFrameRect(QRect(xoffset, 0, w, h) ); |
69 | else | 76 | else |
70 | - changeFrameRect(QRect(0, 0, w-vsbExt, bottom)); | 77 | - changeFrameRect(QRect(0, 0, w-vsbExt, bottom)); |
71 | + changeFrameRect(QRect(xoffset, 0, w-vsbExt, bottom)); | 78 | + changeFrameRect(QRect(xoffset, 0, w-vsbExt, bottom)); |
72 | if (cornerWidget()) { | 79 | if (cornerWidget()) { |
73 | if ( style() == WindowsStyle ) | 80 | if ( style() == WindowsStyle ) |
74 | - setVBarGeometry( d->vbar, w-vsbExt-fw, | 81 | - setVBarGeometry( d->vbar, w-vsbExt-fw, |
75 | - fw, vsbExt, | 82 | - fw, vsbExt, |
76 | - h-hsbExt-fw-fw ); | 83 | - h-hsbExt-fw-fw ); |
77 | + setVBarGeometry( d->vbar, xpos, | 84 | + setVBarGeometry( d->vbar, xpos, |
78 | + ypos, vsbExt, | 85 | + ypos, vsbExt, |
79 | + bottom-fw-ypos ); | 86 | + bottom-fw-ypos ); |
80 | else | 87 | else |
81 | - setVBarGeometry( d->vbar, w-vsbExt, 0, | 88 | - setVBarGeometry( d->vbar, w-vsbExt, 0, |
82 | + setVBarGeometry( d->vbar, xpos, ypos, | 89 | + setVBarGeometry( d->vbar, xpos, ypos, |
83 | vsbExt, | 90 | vsbExt, |
84 | - h-hsbExt ); | 91 | - h-hsbExt ); |
85 | + bottom-ypos ); | 92 | + bottom-ypos ); |
86 | } | 93 | } |
87 | else { | 94 | else { |
88 | if ( style() == WindowsStyle ) | 95 | if ( style() == WindowsStyle ) |
89 | - setVBarGeometry( d->vbar, w-vsbExt-fw, | 96 | - setVBarGeometry( d->vbar, w-vsbExt-fw, |
90 | - fw, vsbExt, | 97 | - fw, vsbExt, |
91 | - bottom-fw-fw ); | 98 | - bottom-fw-fw ); |
92 | + setVBarGeometry( d->vbar, xpos, | 99 | + setVBarGeometry( d->vbar, xpos, |
93 | + ypos, vsbExt, | 100 | + ypos, vsbExt, |
94 | + bottom-fw-ypos ); | 101 | + bottom-fw-ypos ); |
95 | else | 102 | else |
96 | - setVBarGeometry( d->vbar, w-vsbExt, 0, | 103 | - setVBarGeometry( d->vbar, w-vsbExt, 0, |