KLcdDimmer – applet to adjust LCD brightness
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.

klcddimmerapplet.cpp 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /***************************************************************************
  2. * Copyright (C) 2005 by Lorenzo Bettini *
  3. * http://www.lorenzobettini.it *
  4. * *
  5. * This program is free software; you can redistribute it and/or modify *
  6. * it under the terms of the GNU General Public License as published by *
  7. * the Free Software Foundation; either version 2 of the License, or *
  8. * (at your option) any later version. *
  9. * *
  10. * This program is distributed in the hope that it will be useful, *
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  13. * GNU General Public License for more details. *
  14. * *
  15. * You should have received a copy of the GNU General Public License *
  16. * along with this program; if not, write to the *
  17. * Free Software Foundation, Inc., *
  18. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
  19. ***************************************************************************/
  20. #include "klcddimmerapplet.h"
  21. #include <ntqpixmap.h>
  22. #include <ntqlabel.h>
  23. #include <kiconloader.h>
  24. #include <ntqlayout.h>
  25. KlcdDimmerApplet::KlcdDimmerApplet(TQWidget *parent, const char *name)
  26. : TQWidget(parent, name)
  27. {
  28. // the icon and the text will be aligned vertically centered
  29. layout = new TQVBoxLayout(this);
  30. brightnessIcon = new TQLabel(this);
  31. brightnessIcon->setAlignment(AlignCenter);
  32. brightnessIcon->setBackgroundOrigin(AncestorOrigin);
  33. brightnessLevel = new TQLabel(this);
  34. brightnessLevel->setAlignment(AlignCenter);
  35. // use the same background of the panel
  36. brightnessLevel->setBackgroundOrigin(AncestorOrigin);
  37. layout->addWidget(brightnessIcon);
  38. layout->addWidget(brightnessLevel);
  39. brightnessIcon->setPixmap(SmallIcon("klcddimmer"));
  40. }
  41. KlcdDimmerApplet::~KlcdDimmerApplet()
  42. {
  43. }
  44. void KlcdDimmerApplet::setBrightnessLevel(const TQString &level)
  45. {
  46. brightnessLevel->setText(level);
  47. }
  48. #include "klcddimmerapplet.moc"