Commit 5d396835c187c2924946dd4a494486d7b4e1a161

  • Tree SHA1: 281a74d
  • Parent SHA1: 9dcbf2e (make the current applet bigger if the system font size is bigger, otherwise the layout stops working)
  • raw diff | raw patch
Revert "cleanup some dead code"

This reverts commit a3ed120121eabe95d7bcbe649f9b26b6e2b42d35.
  
166166 {
167167 Context::AppletItemOverlay *moveOverlay = new Context::AppletItemOverlay( item, m_toolbar->appletLayout(), this );
168168 connect( moveOverlay, SIGNAL( moveApplet( Plasma::Applet*, int, int ) ), m_cont, SLOT( moveApplet( Plasma::Applet*, int, int ) ) );
169 connect( moveOverlay, SIGNAL( moveApplet( Plasma::Applet*, int, int ) ), this, SLOT( refreshOverlays() ) );
169170 connect( moveOverlay, SIGNAL( deleteApplet( Plasma::Applet* ) ), this, SLOT( appletRemoved( Plasma::Applet* ) ) );
170171 moveOverlay->setPalette( p );
171172 moveOverlay->show();
213213 recreateOverlays();
214214}
215215
216
216217void
218Context::ToolbarView::refreshOverlays()
219{
220 m_toolbar->refreshAddIcons();
221}
222
223void
217224Context::ToolbarView::recreateOverlays()
218225{
219226 DEBUG_BLOCK
241241 {
242242 Context::AppletItemOverlay *moveOverlay = new Context::AppletItemOverlay( item, m_toolbar->appletLayout(), this );
243243 connect( moveOverlay, SIGNAL( moveApplet( Plasma::Applet*, int, int ) ), m_cont, SLOT( moveApplet( Plasma::Applet*, int, int ) ) );
244 connect( moveOverlay, SIGNAL( moveApplet( Plasma::Applet*, int, int ) ), this, SLOT( refreshOverlays() ) );
244245 connect( moveOverlay, SIGNAL( deleteApplet( Plasma::Applet* ) ), this, SLOT( appletRemoved( Plasma::Applet* ) ) );
245246 moveOverlay->setPalette( p );
246247 moveOverlay->show();
  
6060 void toggleConfigMode();
6161 void appletRemoved( Plasma::Applet* );
6262 void appletAdded( Plasma::Applet*, int);
63 void refreshOverlays();
6364 void recreateOverlays();
6465 void installApplets();
6566 void refreshSycoca();
  
132132 // if all applets are removed, re-add the add item
133133 if( m_appletLayout->count() == 2 && m_configMode )
134134 {
135 toggleConfigMode();
135136 m_appletLayout->removeItem( m_configItem );
136137 delete m_configItem;
137138 m_configItem = 0;
162162 DEBUG_BLOCK
163163
164164 debug() << "inserting applet icon in position" << loc;
165 // no config item means this is the first applet being added with no applets shown at all
166165 if( !m_configItem )
167166 {
168167 m_configItem = new AppletToolbarConfigItem( this );
172172
173173 if( m_configMode )
174174 {
175 // loc doesn't take into account additional + icons, also we need to add 1 more + icon
175176 Context::AppletToolbarAppletItem* item = new Context::AppletToolbarAppletItem( this, applet );
176177 item->setConfigEnabled( true );
177178 connect( item, SIGNAL( appletChosen( Plasma::Applet* ) ), this, SIGNAL( showApplet( Plasma::Applet* ) ) );
178
179
179180 // add the item
180181 m_appletLayout->insertItem( loc, item );
181182 }
201201 DEBUG_BLOCK
202202 if( !m_configMode )
203203 {
204 // place add icons in all possible places that the user can add an icon
205
204206 m_configMode = true;
205207
206208 int loc = -1; // location of the configure icon
245245 emit hideAppletExplorer();
246246 }
247247 emit configModeToggled();
248}
249
250void
251Context::AppletToolbar::refreshAddIcons() // SLOT
252{
253 foreach( AppletToolbarAddItem* item, m_configAddIcons )
254 {
255 m_appletLayout->removeItem( item );
256 item->deleteLater();
257 }
258 m_configAddIcons.clear();
259
260 int loc = -1;
261 for( int i = 0; i < m_appletLayout->count(); ++i )
262 {
263 QGraphicsLayoutItem *item = m_appletLayout->itemAt( i );
264 Context::AppletToolbarConfigItem* configItem = dynamic_cast< Context::AppletToolbarConfigItem* >( item );
265 if( configItem )
266 loc = i;
267 }
268
269 if( loc >=0 )
270 newAddItem( loc );
248271}
249272
250273void
  
5656 QGraphicsLinearLayout* appletLayout();
5757 bool configEnabled() const;
5858
59 void appletRemoved( Plasma::Applet* applet );
59 void appletRemoved( Plasma::Applet* applet );
60
61 void refreshAddIcons();
6062 signals:
6163 void showApplet( Plasma::Applet* );
6264 void addAppletToContainment( const QString& pluginName, int loc );