Diffstat (limited to 'pwmanager/pwmanager/pwmviewstyle_1.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | pwmanager/pwmanager/pwmviewstyle_1.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/pwmanager/pwmanager/pwmviewstyle_1.cpp b/pwmanager/pwmanager/pwmviewstyle_1.cpp index 4a7ffd7..7294f34 100644 --- a/pwmanager/pwmanager/pwmviewstyle_1.cpp +++ b/pwmanager/pwmanager/pwmviewstyle_1.cpp | |||
@@ -94,31 +94,50 @@ PwMViewStyle_1::PwMViewStyle_1(PwMView *view) | |||
94 | 94 | ||
95 | #ifndef DESKTOP_VERSION | 95 | #ifndef DESKTOP_VERSION |
96 | QPEApplication::setStylusOperation( categoriesList->viewport(), QPEApplication::RightOnHold ); | 96 | QPEApplication::setStylusOperation( categoriesList->viewport(), QPEApplication::RightOnHold ); |
97 | #endif | 97 | #endif |
98 | 98 | ||
99 | // connections | 99 | // connections |
100 | connect(categoriesList, SIGNAL(highlighted(int)), | 100 | connect(categoriesList, SIGNAL(highlighted(int)), |
101 | view, SLOT(shiftToView())); | 101 | view, SLOT(shiftToView())); |
102 | connect(categoriesList, | 102 | connect(categoriesList, |
103 | SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)), | 103 | SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)), |
104 | this, | 104 | this, |
105 | SLOT(catRightClick(QListBoxItem *, const QPoint &))); | 105 | SLOT(catRightClick(QListBoxItem *, const QPoint &))); |
106 | |||
107 | connect(lv, SIGNAL(toggleOverview()), | ||
108 | this, SLOT(toggleSplitter())); | ||
106 | } | 109 | } |
107 | 110 | ||
108 | PwMViewStyle_1::~PwMViewStyle_1() | 111 | PwMViewStyle_1::~PwMViewStyle_1() |
109 | { | 112 | { |
110 | delete catCtxMenu; | 113 | delete catCtxMenu; |
111 | delete splitter; | 114 | delete splitter; |
112 | } | 115 | } |
116 | void PwMViewStyle_1::toggleSplitter() | ||
117 | { | ||
118 | QValueList<int> si = splitter2->sizes(); | ||
119 | splitter2->toggle(); | ||
120 | QValueList<int> si2 = splitter2->sizes(); | ||
121 | //qDebug("PwMViewStyle_1::toggleSplitter() %d %d %d %d", si[0],si[1],si2[0],si2[1] ); | ||
122 | if ( si[0] == si2[0] && si[1] == si2[1] && si2[1] == 1 ) { | ||
123 | int diff = si[0]/2; | ||
124 | if ( diff > 200 ) | ||
125 | diff = 200; | ||
126 | si[0] -= diff; | ||
127 | si[1] += diff; | ||
128 | splitter2->toggle(); | ||
129 | splitter2->setSizes( si ); | ||
130 | } | ||
131 | } | ||
113 | 132 | ||
114 | void PwMViewStyle_1::catRightClick(QListBoxItem *item, const QPoint &point) | 133 | void PwMViewStyle_1::catRightClick(QListBoxItem *item, const QPoint &point) |
115 | { | 134 | { |
116 | if (!item) | 135 | if (!item) |
117 | return; | 136 | return; |
118 | catCtxMenu->move(point); | 137 | catCtxMenu->move(point); |
119 | catCtxMenu->show(); | 138 | catCtxMenu->show(); |
120 | } | 139 | } |
121 | 140 | ||
122 | void PwMViewStyle_1::delCategory(const QString &cat) | 141 | void PwMViewStyle_1::delCategory(const QString &cat) |
123 | { | 142 | { |
124 | PWM_ASSERT(categoriesList); | 143 | PWM_ASSERT(categoriesList); |