#include "toolswidget.h"
#include "ui_toolswidget.h"
+#include <QDesktopWidget>
+#include "config.h"
+
+using namespace SomePlayer::Storage;
ToolsWidget::ToolsWidget(QWidget *parent) :
QWidget(parent),
connect (ui->nextButton, SIGNAL(clicked()), this, SIGNAL(nextSearch()));
connect (ui->prevButton, SIGNAL(clicked()), this, SIGNAL(prevSearch()));
connect (ui->searchLine, SIGNAL(textEdited(QString)), this, SIGNAL(search(QString)));
+ Config config;
+ _icons_theme = config.getValue("ui/iconstheme").toString();
}
ToolsWidget::~ToolsWidget()
void ToolsWidget::_fullscreen_button() {
_fullscreen = !_fullscreen;
emit toggleFullscreen(_fullscreen);
- ui->fscreenButton->setIcon(QIcon(_fullscreen ? ":/icons/white/window.png" : ":/icons/white/fullscreen.png"));
}
void ToolsWidget::reset() {
ui->searchLine->setText("");
}
+
+void ToolsWidget::setFocus() {
+ ui->searchLine->setFocus();
+}
+
+void ToolsWidget::updateIcons() {
+ Config config;
+ _icons_theme = config.getValue("ui/iconstheme").toString();
+ ui->fscreenButton->setIcon(QIcon(":/icons/"+_icons_theme+"/fullscreen.png"));
+ ui->nextButton->setIcon(QIcon(":/icons/"+_icons_theme+"/forward.png"));
+ ui->prevButton->setIcon(QIcon(":/icons/"+_icons_theme+"/back.png"));
+}
+
+void ToolsWidget::show() {
+ updateIcons();
+ QWidget::show();
+}
+
+void ToolsWidget::toggleArrows(bool state) {
+ ui->nextButton->setVisible(state);
+ ui->prevButton->setVisible(state);
+}
+
+void ToolsWidget::hideFSButton() {
+ ui->fscreenButton->hide();
+}
+
+void ToolsWidget::setFullscreenState(bool on) {
+ ui->fscreenButton->setChecked(on);
+ _fullscreen = on;
+}