KKBSwitch – keyboard layout indicator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

boldmenuitem.h 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /***************************************************************************
  2. boldmenuitem.h - description
  3. -------------------
  4. begin : Sat Sep 1 2001
  5. copyright : (C) 2001 by Leonid Zeitlin
  6. email : lz@europe.com
  7. ***************************************************************************/
  8. /***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************/
  16. #ifndef BOLDMENUITEM_H
  17. #define BOLDMENUITEM_H
  18. #include <ntqmenudata.h>
  19. /**A custom menu item that can display its text in bold
  20. *@author Leonid Zeitlin
  21. * 02.09.2001: somehow I cannot make it work. The item looks ok when not
  22. * selected, but appears empty when selected. I have a suspicion that this
  23. * is a problem with some KDE styles (B3 in particular), the style doesn't
  24. * paint custom menu items correctly. With some other styles, such as TQt built-in
  25. * Windows style, everything works correctly. I suspend the work on this for the
  26. * time being...
  27. */
  28. class BoldMenuItem : public TQCustomMenuItem {
  29. private:
  30. TQString m_text;
  31. TQColor m_active_text_color;
  32. bool m_bold;
  33. TQSize m_size;
  34. public:
  35. BoldMenuItem(const TQString &text, const TQColor &active_text_color, bool bold = false);
  36. ~BoldMenuItem();
  37. TQString& text() { return m_text; };
  38. void setText(const TQString& value) { m_text = value; };
  39. bool bold() { return m_bold; };
  40. void setBold(bool value) { m_bold = value; };
  41. virtual void paint(TQPainter* painter, const TQColorGroup& /*cg*/,
  42. bool act, bool /*enabled*/, int x, int y, int w, int h);
  43. virtual void setFont(const TQFont& font);
  44. virtual TQSize sizeHint() { return m_size; };
  45. };
  46. #endif