1 |
matsuu 10/02/04 16:33:12 |
2 |
|
3 |
Added: uim-1.5.7-kde4.patch uim-1.5.7-kde4-applet.patch |
4 |
Log: |
5 |
Fixed kde4 issue, https://bugs.freedesktop.org/show_bug.cgi?id=24728 |
6 |
(Portage version: 2.1.7.16/cvs/Linux x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 app-i18n/uim/files/uim-1.5.7-kde4.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-i18n/uim/files/uim-1.5.7-kde4.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-i18n/uim/files/uim-1.5.7-kde4.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: uim-1.5.7-kde4.patch |
15 |
=================================================================== |
16 |
Index: qt4/toolbar/common-uimstateindicator.cpp |
17 |
=================================================================== |
18 |
--- qt4/toolbar/common-uimstateindicator.cpp (revision 6120) |
19 |
+++ qt4/toolbar/common-uimstateindicator.cpp (working copy) |
20 |
@@ -40,6 +40,7 @@ |
21 |
#include <QtCore/QTextCodec> |
22 |
#include <QtGui/QHBoxLayout> |
23 |
#include <QtGui/QImage> |
24 |
+#include <QtGui/QMouseEvent> |
25 |
#include <QtGui/QPixmap> |
26 |
|
27 |
#include <cstring> |
28 |
@@ -171,11 +172,17 @@ |
29 |
button->setToolTip( fields[ 3 ] ); |
30 |
|
31 |
// create popup |
32 |
+#ifdef PLASMA_APPLET_UIM |
33 |
+ popupMenu = new QHelperPopupMenu( 0 ); |
34 |
+#else |
35 |
popupMenu = new QHelperPopupMenu( button ); |
36 |
+#endif |
37 |
connect( popupMenu, SIGNAL( aboutToShow() ), |
38 |
this, SLOT( slotPopupMenuAboutToShow() ) ); |
39 |
connect( popupMenu, SIGNAL( aboutToHide() ), |
40 |
this, SLOT( slotPopupMenuAboutToHide() ) ); |
41 |
+ connect( button, SIGNAL( menuRequested( QMenu* ) ), |
42 |
+ this, SIGNAL( menuRequested( QMenu* ) ) ); |
43 |
button->setMenu( popupMenu ); |
44 |
button->setPopupMode( QToolButton::InstantPopup ); |
45 |
|
46 |
@@ -264,7 +271,29 @@ |
47 |
} |
48 |
|
49 |
/**/ |
50 |
+QHelperToolbarButton::QHelperToolbarButton( QWidget *parent ) |
51 |
+ : QToolButton( parent ) |
52 |
+{ |
53 |
+ setAutoRaise( true ); |
54 |
+} |
55 |
|
56 |
+QSize QHelperToolbarButton::sizeHint() const |
57 |
+{ |
58 |
+ return QSize( BUTTON_SIZE, BUTTON_SIZE ); |
59 |
+} |
60 |
+ |
61 |
+void QHelperToolbarButton::mousePressEvent( QMouseEvent *event ) |
62 |
+{ |
63 |
+#ifdef PLASMA_APPLET_UIM |
64 |
+ if ( event->button() == Qt::LeftButton ) |
65 |
+ emit menuRequested( menu() ); |
66 |
+#else |
67 |
+ QToolButton::mousePressEvent( event ); |
68 |
+#endif |
69 |
+} |
70 |
+ |
71 |
+/**/ |
72 |
+ |
73 |
QHelperPopupMenu::QHelperPopupMenu( QWidget *parent ) |
74 |
: QMenu( parent ) |
75 |
{ |
76 |
Index: qt4/toolbar/applet-kde4.h |
77 |
=================================================================== |
78 |
--- qt4/toolbar/applet-kde4.h (revision 6120) |
79 |
+++ qt4/toolbar/applet-kde4.h (working copy) |
80 |
@@ -50,6 +50,7 @@ |
81 |
|
82 |
private slots: |
83 |
void slotToolbarResized(); |
84 |
+ void slotMenuRequested(QMenu *menu); |
85 |
|
86 |
private: |
87 |
void initPopup(); |
88 |
Index: qt4/toolbar/common-uimstateindicator.h |
89 |
=================================================================== |
90 |
--- qt4/toolbar/common-uimstateindicator.h (revision 6120) |
91 |
+++ qt4/toolbar/common-uimstateindicator.h (working copy) |
92 |
@@ -70,6 +70,7 @@ |
93 |
|
94 |
signals: |
95 |
void indicatorResized(); |
96 |
+ void menuRequested( QMenu *menu ); |
97 |
|
98 |
public slots: |
99 |
void slotStdinActivated( int socket ); |
100 |
@@ -91,14 +92,17 @@ |
101 |
|
102 |
class QHelperToolbarButton : public QToolButton |
103 |
{ |
104 |
+ Q_OBJECT |
105 |
public: |
106 |
- explicit QHelperToolbarButton( QWidget *parent = 0 ) |
107 |
- : QToolButton( parent ){ setAutoRaise( true ); } |
108 |
+ explicit QHelperToolbarButton( QWidget *parent = 0 ); |
109 |
|
110 |
- QSize sizeHint() const |
111 |
- { |
112 |
- return QSize( BUTTON_SIZE, BUTTON_SIZE ); |
113 |
- } |
114 |
+ QSize sizeHint() const; |
115 |
+ |
116 |
+signals: |
117 |
+ void menuRequested( QMenu *menu ); |
118 |
+ |
119 |
+private: |
120 |
+ void mousePressEvent( QMouseEvent *event ); |
121 |
}; |
122 |
|
123 |
class QHelperPopupMenu : public QMenu |
124 |
Index: qt4/toolbar/common-quimhelpertoolbar.cpp |
125 |
=================================================================== |
126 |
--- qt4/toolbar/common-quimhelpertoolbar.cpp (revision 6120) |
127 |
+++ qt4/toolbar/common-quimhelpertoolbar.cpp (working copy) |
128 |
@@ -56,7 +56,10 @@ |
129 |
m_indicator = new UimStateIndicator( this ); |
130 |
m_layout->addWidget( m_indicator ); |
131 |
|
132 |
- connect( m_indicator, SIGNAL( indicatorResized() ), this, SLOT( slotIndicatorResized() ) ); |
133 |
+ connect( m_indicator, SIGNAL( indicatorResized() ), |
134 |
+ this, SLOT( slotIndicatorResized() ) ); |
135 |
+ connect( m_indicator, SIGNAL( menuRequested( QMenu* ) ), |
136 |
+ this, SIGNAL( menuRequested( QMenu* ) ) ); |
137 |
|
138 |
QPixmap swicon = QPixmap( ICONDIR + "/im_switcher.png" ); |
139 |
QPixmap preficon = QPixmap( ACTION_ICONDIR + "/configure.png"); |
140 |
@@ -87,7 +90,7 @@ |
141 |
exiticon = QPixmap::fromImage( exitimage.scaled( ICON_SIZE, ICON_SIZE, |
142 |
Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) ); |
143 |
|
144 |
- m_contextMenu = new QMenu( this ); |
145 |
+ m_contextMenu = new QMenu( isApplet ? 0 : this ); |
146 |
m_contextMenu->addAction( m_swicon, _("Switch input method"), |
147 |
this, SLOT(slotExecImSwitcher()) ); |
148 |
m_contextMenu->addAction( m_preficon, _("Preference"), |
149 |
@@ -129,8 +132,13 @@ |
150 |
{ |
151 |
if( m_contextMenu->isHidden() ) |
152 |
{ |
153 |
+#ifdef PLASMA_APPLET_UIM |
154 |
+ Q_UNUSED( e ); |
155 |
+ emit menuRequested( m_contextMenu ); |
156 |
+#else |
157 |
m_contextMenu->move( e->globalPos() ); |
158 |
m_contextMenu->exec(); |
159 |
+#endif |
160 |
} |
161 |
} |
162 |
|
163 |
Index: qt4/toolbar/common-quimhelpertoolbar.h |
164 |
=================================================================== |
165 |
--- qt4/toolbar/common-quimhelpertoolbar.h (revision 6120) |
166 |
+++ qt4/toolbar/common-quimhelpertoolbar.h (working copy) |
167 |
@@ -80,6 +80,7 @@ |
168 |
signals: |
169 |
void quitToolbar(); |
170 |
void toolbarResized(); |
171 |
+ void menuRequested( QMenu *menu ); |
172 |
|
173 |
protected: |
174 |
UimStateIndicator *m_indicator; |
175 |
Index: qt4/toolbar/applet-kde4.cpp |
176 |
=================================================================== |
177 |
--- qt4/toolbar/applet-kde4.cpp (revision 6120) |
178 |
+++ qt4/toolbar/applet-kde4.cpp (working copy) |
179 |
@@ -61,6 +61,8 @@ |
180 |
m_toolbar->setAttribute(Qt::WA_NoSystemBackground); |
181 |
connect(m_toolbar, SIGNAL(toolbarResized()), |
182 |
this, SLOT(slotToolbarResized())); |
183 |
+ connect(m_toolbar, SIGNAL(menuRequested(QMenu*)), |
184 |
+ this, SLOT(slotMenuRequested(QMenu*))); |
185 |
|
186 |
m_proxy = new QGraphicsProxyWidget; |
187 |
m_proxy->setWidget(m_toolbar); |
188 |
@@ -115,6 +117,12 @@ |
189 |
resize(m_toolbar->width() + lr, m_toolbar->height() + tb); |
190 |
} |
191 |
|
192 |
+void UimApplet::slotMenuRequested(QMenu *menu) |
193 |
+{ |
194 |
+ menu->adjustSize(); |
195 |
+ menu->exec(popupPosition(menu->size())); |
196 |
+} |
197 |
+ |
198 |
QGraphicsWidget *UimApplet::graphicsWidget() |
199 |
{ |
200 |
return m_widget; |
201 |
Index: qt4/toolbar/CMakeLists.txt |
202 |
=================================================================== |
203 |
--- qt4/toolbar/CMakeLists.txt (revision 6120) |
204 |
+++ qt4/toolbar/CMakeLists.txt (working copy) |
205 |
@@ -3,7 +3,7 @@ |
206 |
find_package(KDE4 REQUIRED) |
207 |
include(KDE4Defaults) |
208 |
|
209 |
-add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) |
210 |
+add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -DPLASMA_APPLET_UIM) |
211 |
include_directories(${KDE4_INCLUDES} |
212 |
${CMAKE_SOURCE_DIR}/../.. ${CMAKE_SOURCE_DIR}/../../uim |
213 |
${CMAKE_SOURCE_DIR}/../../replace ${CMAKE_SOURCE_DIR}/..) |
214 |
|
215 |
|
216 |
|
217 |
1.1 app-i18n/uim/files/uim-1.5.7-kde4-applet.patch |
218 |
|
219 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-i18n/uim/files/uim-1.5.7-kde4-applet.patch?rev=1.1&view=markup |
220 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-i18n/uim/files/uim-1.5.7-kde4-applet.patch?rev=1.1&content-type=text/plain |
221 |
|
222 |
Index: uim-1.5.7-kde4-applet.patch |
223 |
=================================================================== |
224 |
diff -Naur uim-1.5.7.orig/configure.ac uim-1.5.7/configure.ac |
225 |
--- uim-1.5.7.orig/configure.ac 2009-11-21 21:55:15.000000000 +0900 |
226 |
+++ uim-1.5.7/configure.ac 2010-02-05 01:00:37.000000000 +0900 |
227 |
@@ -1259,7 +1259,7 @@ |
228 |
@<:@default=yes@:>@]), |
229 |
enable_kde4_applet=$enableval, |
230 |
enable_kde4_applet=yes) |
231 |
-case "$enable_kde_applet" in |
232 |
+case "$enable_kde4_applet" in |
233 |
no) |
234 |
use_applet_kde4="no" |
235 |
;; |