By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 1499
Collapse All | Expand All

(-) (+84 lines)
Added Link Here
1
/*****************************************************************
2
3
Copyright (c) 2007 Montel Laurent <lmontel@mandriva.com>
4
5
Permission is hereby granted, free of charge, to any person obtaining a copy
6
of this software and associated documentation files (the "Software"), to deal
7
in the Software without restriction, including without limitation the rights
8
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
copies of the Software, and to permit persons to whom the Software is
10
furnished to do so, subject to the following conditions:
11
12
The above copyright notice and this permission notice shall be included in
13
all copies or substantial portions of the Software.
14
15
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
18
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22
******************************************************************/
23
24
#include "popupmenutop.h"
25
#include "kickerSettings.h"
26
#include <kstandarddirs.h>
27
#include <tqimage.h>
28
#include <kdebug.h>
29
30
PopupMenuTop::PopupMenuTop() : 
31
        TQCustomMenuItem()
32
{
33
  init();
34
}
35
36
void PopupMenuTop::init()
37
{
38
  TQString leftSideName = KickerSettings::leftSideTopPixmapName();
39
  TQString rightSideName = KickerSettings::rightSideTopPixmapName();
40
  TQString sideTileName = KickerSettings::sideTopTileName();
41
42
  leftSidePixmap.load(locate("data", "kicker/pics/" + leftSideName));
43
  rightSidePixmap.load(locate("data", "kicker/pics/" + rightSideName));
44
  sideTilePixmap.load(locate("data", "kicker/pics/" + sideTileName));
45
  
46
  if (sideTilePixmap.isNull())
47
    {
48
      kdDebug(1210) << "Can't find a side tile pixmap" << endl;
49
      return;
50
    }
51
  
52
  if (leftSidePixmap.height() != sideTilePixmap.height() || 
53
      leftSidePixmap.height() != rightSidePixmap.height())
54
    {
55
      kdDebug(1210) << "Pixmaps have to be the same size" << endl;
56
      return;
57
    }
58
  if (sideTilePixmap.width() < 100)
59
    {
60
      int tiles = (int)(100 / sideTilePixmap.width()) + 1;
61
      TQPixmap preTiledPixmap(sideTilePixmap.width()*tiles, sideTilePixmap.height());
62
      TQPainter p2(&preTiledPixmap);
63
      p2.drawTiledPixmap(preTiledPixmap.rect(), sideTilePixmap);
64
      sideTilePixmap = preTiledPixmap;
65
    }
66
}
67
68
void PopupMenuTop::paint(TQPainter* p, const TQColorGroup& cg, 
69
	   bool /* act */, bool /*enabled*/, 
70
	   int x, int y, int w, int h)
71
{
72
  //kdDebug()<<" PopupMenuTop::paint\n";
73
  p->save();
74
  p->drawPixmap( x,y, leftSidePixmap );
75
  p->drawTiledPixmap(TQRect(x+leftSidePixmap.width(),y,w,h),sideTilePixmap);
76
  p->drawPixmap( x + w - rightSidePixmap.width(), y, rightSidePixmap );
77
  p->restore();
78
}
79
80
TQSize PopupMenuTop::sizeHint()
81
{
82
  TQSize size = TQSize(50,sideTilePixmap.height());
83
  return size;
84
}
(-) (+54 lines)
Added Link Here
1
/*****************************************************************
2
3
Copyright (c) 2007 Montel Laurent <lmontel@mandriva.com>
4
5
Permission is hereby granted, free of charge, to any person obtaining a copy
6
of this software and associated documentation files (the "Software"), to deal
7
in the Software without restriction, including without limitation the rights
8
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
copies of the Software, and to permit persons to whom the Software is
10
furnished to do so, subject to the following conditions:
11
12
The above copyright notice and this permission notice shall be included in
13
all copies or substantial portions of the Software.
14
15
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
18
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22
******************************************************************/
23
24
#ifndef POPUPMENUTOP_H
25
#define POPUPMENUTOP_H
26
27
#include <tqfont.h>
28
#include <tqstring.h>
29
#include <tqstyle.h>
30
#include <tqpainter.h>
31
#include <tqmenudata.h>
32
33
#include <tdeapplication.h>
34
35
class PopupMenuTop : public TQCustomMenuItem
36
{
37
public:
38
    PopupMenuTop();
39
40
    bool fullSpan () const { return true; }
41
42
    TQSize sizeHint();
43
44
    void paint(TQPainter* p, const TQColorGroup& cg, 
45
	   bool /* act */, bool /*enabled*/, 
46
	       int x, int y, int w, int h);
47
 private:
48
    void init();
49
     TQPixmap leftSidePixmap;
50
     TQPixmap rightSidePixmap;
51
     TQPixmap sideTilePixmap;
52
};
53
54
#endif
(-)a/kicker/kicker/ui/CMakeLists.txt (-1 / +1 lines)
Lines 48-54 set( ${target}_SRCS Link Here
48
  extensionop_mnu.cpp k_mnu_stub.cpp recentapps.cpp
48
  extensionop_mnu.cpp k_mnu_stub.cpp recentapps.cpp
49
  browser_dlg.cpp itemview.cpp kickoff_bar.cpp removeapplet_mnu.cpp
49
  browser_dlg.cpp itemview.cpp kickoff_bar.cpp removeapplet_mnu.cpp
50
  removeextension_mnu.cpp removecontainer_mnu.cpp removebutton_mnu.cpp
50
  removeextension_mnu.cpp removecontainer_mnu.cpp removebutton_mnu.cpp
51
  popupmenutitle.cpp hidebutton.cpp addappletvisualfeedback.cpp
51
  popupmenutitle.cpp hidebutton.cpp popupmenutop.cpp addappletvisualfeedback.cpp
52
  clicklineedit.cpp flipscrollview.cpp media_watcher.cpp
52
  clicklineedit.cpp flipscrollview.cpp media_watcher.cpp
53
  media_watcher.skel mykickoffsearchinterface.cpp query.cpp
53
  media_watcher.skel mykickoffsearchinterface.cpp query.cpp
54
)
54
)
(-)a/kicker/kicker/ui/Makefile.am (-1 / +1 lines)
Lines 12-18 libkicker_ui_la_SOURCES = addbutton_mnu.cpp appletitem.ui appletview.ui addapple Link Here
12
        addextension_mnu.cpp extensionop_mnu.cpp k_mnu_stub.cpp \
12
        addextension_mnu.cpp extensionop_mnu.cpp k_mnu_stub.cpp \
13
        recentapps.cpp browser_dlg.cpp itemview.cpp kickoff_bar.cpp \
13
        recentapps.cpp browser_dlg.cpp itemview.cpp kickoff_bar.cpp \
14
        removeapplet_mnu.cpp removeextension_mnu.cpp removecontainer_mnu.cpp \
14
        removeapplet_mnu.cpp removeextension_mnu.cpp removecontainer_mnu.cpp \
15
        removebutton_mnu.cpp popupmenutitle.cpp hidebutton.cpp \
15
        removebutton_mnu.cpp popupmenutitle.cpp popupmenutop.cpp hidebutton.cpp \
16
        addappletvisualfeedback.cpp clicklineedit.cpp flipscrollview.cpp \
16
        addappletvisualfeedback.cpp clicklineedit.cpp flipscrollview.cpp \
17
        media_watcher.cpp media_watcher.skel mykickoffsearchinterface.cpp query.cpp
17
        media_watcher.cpp media_watcher.skel mykickoffsearchinterface.cpp query.cpp
18
18
(-)a/kicker/kicker/ui/k_mnu.cpp (-2 / +38 lines)
Lines 51-56 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Link Here
51
#include <kstandarddirs.h>
51
#include <kstandarddirs.h>
52
#include <tdetoolbarbutton.h>
52
#include <tdetoolbarbutton.h>
53
#include <twin.h>
53
#include <twin.h>
54
#include <popupmenutop.h>
54
55
55
#include "client_mnu.h"
56
#include "client_mnu.h"
56
#include "container_base.h"
57
#include "container_base.h"
Lines 156-162 void PanelKMenu::windowClearTimeout() Link Here
156
157
157
bool PanelKMenu::loadSidePixmap()
158
bool PanelKMenu::loadSidePixmap()
158
{
159
{
159
    if (!KickerSettings::useSidePixmap())
160
    if (!KickerSettings::useSidePixmap() || KickerSettings::useTopSide())
160
    {
161
    {
161
        return false;
162
        return false;
162
    }
163
    }
Lines 754-761 void PanelKMenu::createRecentMenuItems() Link Here
754
    if (RecentApps.count() > 0)
755
    if (RecentApps.count() > 0)
755
    {
756
    {
756
        bool bSeparator = KickerSettings::showMenuTitles();
757
        bool bSeparator = KickerSettings::showMenuTitles();
758
        bool bTitleTop = KickerSettings::useTopSide();
757
        int nId = serviceMenuEndId() + 1;
759
        int nId = serviceMenuEndId() + 1;
758
        int nIndex = KickerSettings::showMenuTitles() ? 1 : 0;
760
761
        int nIndex;
762
        if( bTitleTop ) {
763
            nIndex = KickerSettings::showMenuTitles() ? 2 : 0;
764
        } else {
765
            nIndex = KickerSettings::showMenuTitles() ? 1 : 0;
766
        }
759
767
760
        for (TQValueList<TQString>::ConstIterator it =
768
        for (TQValueList<TQString>::ConstIterator it =
761
             RecentApps.fromLast(); /*nop*/; --it)
769
             RecentApps.fromLast(); /*nop*/; --it)
Lines 775-780 void PanelKMenu::createRecentMenuItems() Link Here
775
                            RecentlyLaunchedApps::the().caption(), font()),
783
                            RecentlyLaunchedApps::the().caption(), font()),
776
                        serviceMenuEndId(), 0);
784
                        serviceMenuEndId(), 0);
777
                    setItemEnabled( id, false );
785
                    setItemEnabled( id, false );
786
                    if( bTitleTop) {
787
                        id = insertItem(new PopupMenuTop(),serviceMenuEndId(),0);
788
                        setItemEnabled( id, false );
789
                    }
778
                }
790
                }
779
                insertMenuItem(s, nId++, nIndex);
791
                insertMenuItem(s, nId++, nIndex);
780
                RecentlyLaunchedApps::the().m_nNumMenuItems++;
792
                RecentlyLaunchedApps::the().m_nNumMenuItems++;
Lines 791-796 void PanelKMenu::createRecentMenuItems() Link Here
791
            insertSeparator(RecentlyLaunchedApps::the().m_nNumMenuItems);
803
            insertSeparator(RecentlyLaunchedApps::the().m_nNumMenuItems);
792
        }
804
        }
793
    }
805
    }
806
    else if(KickerSettings::useTopSide())
807
    {
808
        int id = insertItem(new PopupMenuTop(),serviceMenuEndId(),0);
809
        setItemEnabled( id, false );
810
    }
794
}
811
}
795
812
796
void PanelKMenu::clearSubmenus()
813
void PanelKMenu::clearSubmenus()
Lines 822-827 void PanelKMenu::updateRecent() Link Here
822
839
823
    RecentlyLaunchedApps::the().m_bNeedToUpdate = false;
840
    RecentlyLaunchedApps::the().m_bNeedToUpdate = false;
824
841
842
    bool bTitleTop = KickerSettings::useTopSide();
843
825
    int nId = serviceMenuEndId() + 1;
844
    int nId = serviceMenuEndId() + 1;
826
845
827
    // remove previous items
846
    // remove previous items
Lines 829-834 void PanelKMenu::updateRecent() Link Here
829
    {
848
    {
830
        // -1 --> menu title
849
        // -1 --> menu title
831
        int i = KickerSettings::showMenuTitles() ? -1 : 0;
850
        int i = KickerSettings::showMenuTitles() ? -1 : 0;
851
        if(bTitleTop) {
852
            i = KickerSettings::showMenuTitles() ? -2 : 0;
853
        }
854
832
        for (; i < RecentlyLaunchedApps::the().m_nNumMenuItems; i++)
855
        for (; i < RecentlyLaunchedApps::the().m_nNumMenuItems; i++)
833
        {
856
        {
834
            removeItem(nId + i);
857
            removeItem(nId + i);
Lines 842-847 void PanelKMenu::updateRecent() Link Here
842
        }
865
        }
843
    }
866
    }
844
867
868
    if(bTitleTop) {
869
        removeItemAt(0);
870
    }
871
845
    // insert new items
872
    // insert new items
846
    TQStringList RecentApps;
873
    TQStringList RecentApps;
847
    RecentlyLaunchedApps::the().getRecentApps(RecentApps);
874
    RecentlyLaunchedApps::the().getRecentApps(RecentApps);
Lines 866-871 void PanelKMenu::updateRecent() Link Here
866
                        RecentlyLaunchedApps::the().caption(),
893
                        RecentlyLaunchedApps::the().caption(),
867
                            font()), nId - 1, 0);
894
                            font()), nId - 1, 0);
868
                    setItemEnabled( id, false );
895
                    setItemEnabled( id, false );
896
                    if(bTitleTop) {
897
                        id = insertItem(new PopupMenuTop(),nId - 1,0);
898
                        setItemEnabled( id, false );
899
                    }
869
                }
900
                }
870
                insertMenuItem(s, nId++, KickerSettings::showMenuTitles() ?
901
                insertMenuItem(s, nId++, KickerSettings::showMenuTitles() ?
871
                    1 : 0);
902
                    1 : 0);
Lines 881-886 void PanelKMenu::updateRecent() Link Here
881
            insertSeparator(RecentlyLaunchedApps::the().m_nNumMenuItems);
912
            insertSeparator(RecentlyLaunchedApps::the().m_nNumMenuItems);
882
        }
913
        }
883
    }
914
    }
915
    else if(bTitleTop)
916
    {
917
        int id = insertItem(new PopupMenuTop(),serviceMenuEndId(),0);
918
        setItemEnabled( id, false );
919
    }
884
}
920
}
885
921
886
void PanelKMenu::clearRecentMenuItems()
922
void PanelKMenu::clearRecentMenuItems()
(-)a/kicker/libkicker/kickerSettings.kcfg (+20 lines)
Lines 369-374 Link Here
369
      <default>true</default>
369
      <default>true</default>
370
   </entry>
370
   </entry>
371
371
372
   <entry name="UseTopSide" type="Bool" >
373
      <label>Use side image on top of Kmenu</label>
374
      <default>true</default>
375
   </entry>
376
377
   <entry name="LeftSideTopPixmapName" key="LeftSideTopName" type="String" >
378
      <label>The name of the file to use as the side image in the TDE Menu</label>
379
      <default>kside_top_left.png</default>
380
   </entry>
381
382
   <entry name="RightSideTopPixmapName" key="RightSideTopName" type="String" >
383
      <label>The name of the file to use as the side image in the TDE Menu</label>
384
      <default>kside_top_right.png</default>
385
   </entry>
386
387
   <entry name="SideTopTileName" key="SideTopTileName" type="String" >
388
      <label>The name of the file used as a tile to fill the height of TDE Menu that SidePixmapName does not cover</label>
389
      <default>kside_top_tile.png</default>
390
   </entry>
391
372
<entry name="SidePixmapName" key="SideName" type="String" >
392
<entry name="SidePixmapName" key="SideName" type="String" >
373
      <label>The name of the file to use as the side image in the TDE Menu</label>
393
      <label>The name of the file to use as the side image in the TDE Menu</label>
374
      <default>kside.png</default>
394
      <default>kside.png</default>

Return to bug 1499