+case (0.1.1) unstable; urgency=low
+
+ * Added icons for the buttons
+
+ -- Lukas Hrazky <lukkash@email.cz> Wed, 21 Jul 2010 23:33:54 +0200
+
case (0.1.0) unstable; urgency=low
* First release
pPji1Kr4JSFDziowC844FwkQBoFdT1zPCdAghMM6IZyGprM7c1zDIpzElw6n
ITi7bcVZwOBCEA4HqXDrQk/gEoGUkXJT72ZC/h9bZg7QiEKVqwAAAABJRU5E
rkJggg==
+XB-Maemo-Upgrade-Description:
+ - added icons for the buttons
case usr/bin/
case.desktop usr/share/applications/hildon/
case.png usr/share/pixmaps/
+pixmaps/* usr/share/pixmaps/case/
--- /dev/null
+/* XPM */
+static char * clone_xpm[] = {
+"48 48 3 1",
+" c None",
+". c #FFFFFF",
+"+ c #0000FF",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ....... ",
+" ....+++++++... ",
+" ..++++++++++++++.. ",
+" .++++++++++++++++++.. ",
+" .++++..........+++++++. ",
+" .+++.. ..++++++.. . ",
+" .+++. ..++++++. .. ",
+" .++.. .++++++. .+. ",
+" .++. .++++++. .++. ",
+" .++. .++++++..+++. ",
+" .++. .++++++++++. ",
+" .+. .+++++++++. ",
+" .+. .++++++++. ",
+" .+. .+++++++. ",
+" .+. .++++++++. ",
+" .. .+++++++++. ",
+" .++++++++++. ",
+" .+++++++++++. ",
+" .............. ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" "};
--- /dev/null
+/* XPM */
+static char * copy_xpm[] = {
+"48 48 3 1",
+" c None",
+". c #FFFFFF",
+"+ c #0000FF",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" .... ",
+" .++. ",
+" .++. ",
+" .++. ",
+" .....++..... ",
+" .++++++++++. ",
+" .++++++++++. ",
+" .....++..... ",
+" .++. ",
+" .++. ",
+" .++. ",
+" .... .. ",
+" .+. ",
+" .++. ",
+" .+++. ",
+" .......................++++. ",
+" .+++++++++++++++++++++++++++. ",
+" .++++++++++++++++++++++++++++. ",
+" .+++++++++++++++++++++++++++++. ",
+" .++++++++++++++++++++++++++++. ",
+" .+++++++++++++++++++++++++++. ",
+" .......................++++. ",
+" .+++. ",
+" .++. ",
+" .+. ",
+" .. ",
+" ",
+" ",
+" ",
+" ................... ................... ",
+" .+++++++++++++++++. .+++++++++++++++++. ",
+" .+++++++++++++++++. .+++++++++++++++++. ",
+" .+++++++++++++++++. .+++++++++++++++++. ",
+" ................... ................... ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" "};
--- /dev/null
+/* XPM */
+static char * delete_xpm[] = {
+"48 48 3 1",
+" c None",
+". c #FFFFFF",
+"+ c #0000FF",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" .. .. ",
+" .++. .++. ",
+" .++++. .++++. ",
+" .++++++. .++++++. ",
+" .++++++. .++++++. ",
+" .++++++..++++++. ",
+" .++++++++++++. ",
+" .++++++++++. ",
+" .++++++++. ",
+" .++++++. ",
+" .++++++++. ",
+" .++++++++++. ",
+" .++++++++++++. ",
+" .++++++..++++++. ",
+" .++++++. .++++++. ",
+" .++++++. .++++++. ",
+" .++++. .++++. ",
+" .++. .++. ",
+" .. .. ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" . . . . . . . . . . ",
+" ",
+" . . ",
+" ",
+" . . . . . . . . . . ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" "};
--- /dev/null
+/* XPM */
+static char * go_up_xpm[] = {
+"48 48 3 1",
+" c None",
+". c #FFFFFF",
+"+ c #0000FF",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" . ",
+" .+. ",
+" .+++. ",
+" .+++++. ",
+" .+++++++. ",
+" .+++++++++. ",
+" .+++++++++++. ",
+" .+++++++++++++. ",
+" .....+++++..... ",
+" .+++++. ",
+" .+++++. ",
+" .+++++. ",
+" .+++++. ",
+" .+++++. ",
+" .+++++. ",
+" .+++++. ",
+" .+++++. ",
+" .+++++. ",
+" .+++++.................... ",
+" .++++++++++++++++++++++++. ",
+" .++++++++++++++++++++++++. ",
+" .++++++++++++++++++++++++. ",
+" .++++++++++++++++++++++++. ",
+" .......................... ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" "};
--- /dev/null
+/* XPM */
+static char * move_xpm[] = {
+"48 48 3 1",
+" c None",
+". c #FFFFFF",
+"+ c #0000FF",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" .. ",
+" .+. ",
+" .++. ",
+" .+++. ",
+" .......................++++. ",
+" .+++++++++++++++++++++++++++. ",
+" .++++++++++++++++++++++++++++. ",
+" .+++++++++++++++++++++++++++++. ",
+" .++++++++++++++++++++++++++++. ",
+" .+++++++++++++++++++++++++++. ",
+" .......................++++. ",
+" .+++. ",
+" .++. ",
+" .+. ",
+" .. ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" . . . . . . . . . . ................... ",
+" .+++++++++++++++++. ",
+" . . .+++++++++++++++++. ",
+" .+++++++++++++++++. ",
+" . . . . . . . . . . ................... ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" "};
--- /dev/null
+/* XPM */
+static char * swap_xpm[] = {
+"48 48 3 1",
+" c None",
+". c #FFFFFF",
+"+ c #0000FF",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ......... ",
+" ...+++++++++.. ",
+" .++++++++++++++.. ",
+" ..+++++++++++++++++.. ",
+" .+++++++......++++++++. ",
+" .+++++... ..+++++++. ",
+" .++++.. ..++++++. .. ",
+" .+++.. .++++++. .+. ",
+" .+++. ..+++++. .++. ",
+" .+++. .+++++.+++. ",
+" .+++. .++++++++. ",
+" .+++. .+++++++. ",
+" .++. .++++++. ",
+" .++. .+++++++. ",
+" .+. .++++++++. ",
+" .. .+++++++++. ",
+" ........... ",
+" ",
+" ",
+" ",
+" ",
+" ........... ",
+" .+++++++++. .. ",
+" .++++++++. .+. ",
+" .+++++++. .++. ",
+" .++++++. .++. ",
+" .+++++++. .+++. ",
+" .++++++++. .+++. ",
+" .+++.+++++. .+++. ",
+" .++. .+++++.. .+++. ",
+" .+. .++++++. ..+++. ",
+" .. .++++++.. ..++++. ",
+" .+++++++.. ...+++++. ",
+" .++++++++......+++++++. ",
+" ..+++++++++++++++++.. ",
+" ..++++++++++++++. ",
+" ..+++++++++... ",
+" ......... ",
+" ",
+" ",
+" ",
+" ",
+" "};
#include "button.h"
+#include <iostream>
+
+#define ICON_PATH QString("/usr/share/pixmaps/case/")
+#define ICON_SET "default"
-Button::Button(QWidget *parent, const int maxWidth, const int maxHeight) : QPushButton(parent) {
- setMaximumWidth(maxWidth);
- setMaximumHeight(maxHeight);
-}
-Button::Button(const QString &text, QWidget *parent, const int maxWidth, const int maxHeight) :
- QPushButton(text, parent)
+Button::Button(const QString &name, QWidget *parent, const int maxWidth, const int maxHeight) :
+ QPushButton(parent),
+ iconIndex(0)
{
setMaximumWidth(maxWidth);
setMaximumHeight(maxHeight);
+
+ QImage iconImage(ICON_PATH + ICON_SET + "/" + name + ".xpm", "XPM");
+ if (iconImage.isNull()) iconImage.load(ICON_PATH + ICON_SET + "/" + name + ".png", "PNG");
+ if (iconImage.isNull()) iconImage.load(ICON_PATH + ICON_SET + "/" + name + ".gif", "GIF");
+
+ iconImage = iconImage.convertToFormat(QImage::Format_Indexed8);
+
+ QRgb buttonText = palette().color(QPalette::ButtonText).rgb();
+ QRgb highlight = palette().color(QPalette::Highlight).rgb();
+ QVector<QRgb> colorTable = iconImage.colorTable();
+ for (QVector<QRgb>::iterator it = colorTable.begin(); it != colorTable.end(); ++it) {
+ if ((*it & 0xFFFFFF) == 0xFFFFFF) *it = (*it & 0xFF000000) | buttonText;
+ else if ((*it & 0xFFFFFF) == 0x0000FF) *it = (*it & 0xFF000000) | highlight;
+ }
+ iconImage.setColorTable(colorTable);
+
+ icons[0] = QIcon(QPixmap::fromImage(iconImage));
+ icons[1] = QIcon(QPixmap::fromImage(iconImage.mirrored(true, false)));
+
+ setIcon(icons[0]);
}
-Button::Button(const QIcon &icon, const QString &text, QWidget *parent, const int maxWidth, const int maxHeight) :
- QPushButton(icon, text, parent)
-{
- setMaximumWidth(maxWidth);
- setMaximumHeight(maxHeight);
+
+void Button::swapIcon() {
+ iconIndex = (iconIndex + 1) % 2;
+ setIcon(icons[iconIndex]);
}
Q_OBJECT
public:
- explicit Button(QWidget *parent = 0, int maxWidth = 70, int maxHeight = 70);
- explicit Button(const QString &text, QWidget *parent = 0, const int maxWidth = 70, const int maxHeight = 70);
- explicit Button(const QIcon &icon, const QString &text, QWidget *parent = 0, const int maxWidth = 70, const int maxHeight = 70);
+ explicit Button(const QString &name, QWidget *parent = 0, const int maxWidth = 70, const int maxHeight = 70);
+
+public slots:
+ void swapIcon();
+
+protected:
+ QIcon icons[2];
+ int iconIndex;
};
#endif // BUTTON_H
rightPane(new Pane(this)),
activePane(leftPane),
inactivePane(rightPane),
- cloneBtn(new Button(">", 0, 60, 70)),
- swapBtn(new Button("<>", 0, 60, 70)),
- copyBtn(new Button("cp>", 0, 60, 70)),
- moveBtn(new Button("mv>", 0, 60, 70)),
- delBtn(new Button("rm", 0, 60, 70)),
+ cloneBtn(new Button("clone", 0, 60, 70)),
+ swapBtn(new Button("swap", 0, 60, 70)),
+ copyBtn(new Button("copy", 0, 60, 70)),
+ moveBtn(new Button("move", 0, 60, 70)),
+ delBtn(new Button("delete", 0, 60, 70)),
fileOperator(new FileOperator(this))
{
QVBoxLayout *layout = new QVBoxLayout;
activePane = inactivePane;
inactivePane = tmpPane;
- if (leftPane == activePane) {
- cloneBtn->setText(">");
- copyBtn->setText("cp>");
- moveBtn->setText("mv>");
- } else {
- cloneBtn->setText("<");
- copyBtn->setText("<cp");
- moveBtn->setText("<mv");
- }
+ cloneBtn->swapIcon();
+ swapBtn->swapIcon();
+ copyBtn->swapIcon();
+ moveBtn->swapIcon();
+ delBtn->swapIcon();
emit activePaneSwitched();
}
theCase(theCase),
active(false),
location(new AddressBar),
- up(new Button("^", 0, 70, 60)),
+ up(new Button("go_up", 0, 70, 60)),
fileList(new FileList)
{
QVBoxLayout *layout = new QVBoxLayout;