mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2024-12-27 08:43:01 +01:00
Remove info frame from DeviceViewContainer
Was broken and caused yellow background on windows
This commit is contained in:
parent
08fcedd925
commit
f5ba8da3c7
@ -22,48 +22,14 @@
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QWidget>
|
||||
#include <QColor>
|
||||
#include <QFrame>
|
||||
#include <QIcon>
|
||||
#include <QLabel>
|
||||
#include <QPalette>
|
||||
#include <QToolButton>
|
||||
#include <QShowEvent>
|
||||
|
||||
#include "core/iconloader.h"
|
||||
|
||||
#include "deviceviewcontainer.h"
|
||||
#include "ui_deviceviewcontainer.h"
|
||||
|
||||
DeviceViewContainer::DeviceViewContainer(QWidget *parent) : QWidget(parent), ui_(new Ui::DeviceViewContainer), loaded_icons_(false) {
|
||||
|
||||
DeviceViewContainer::DeviceViewContainer(QWidget *parent) : QWidget(parent), ui_(new Ui_DeviceViewContainer) {
|
||||
ui_->setupUi(this);
|
||||
|
||||
QPalette palette(ui_->windows_is_broken_frame->palette());
|
||||
palette.setColor(QPalette::Background, QColor(255, 255, 222));
|
||||
ui_->windows_is_broken_frame->setPalette(palette);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
ui_->windows_is_broken_frame->show();
|
||||
#else
|
||||
ui_->windows_is_broken_frame->hide();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
DeviceViewContainer::~DeviceViewContainer() { delete ui_; }
|
||||
|
||||
void DeviceViewContainer::showEvent(QShowEvent *e) {
|
||||
|
||||
if (!loaded_icons_) {
|
||||
loaded_icons_ = true;
|
||||
|
||||
ui_->close_frame_button->setIcon(IconLoader::Load("edit-delete"));
|
||||
ui_->warning_icon->setPixmap(IconLoader::Load("dialog-warning").pixmap(22));
|
||||
}
|
||||
|
||||
QWidget::showEvent(e);
|
||||
|
||||
}
|
||||
|
||||
DeviceView *DeviceViewContainer::view() const { return ui_->view; }
|
||||
|
@ -30,11 +30,8 @@
|
||||
#include <QString>
|
||||
#include <QShowEvent>
|
||||
|
||||
namespace Ui {
|
||||
class DeviceViewContainer;
|
||||
}
|
||||
|
||||
class DeviceView;
|
||||
class Ui_DeviceViewContainer;
|
||||
|
||||
class DeviceViewContainer : public QWidget {
|
||||
Q_OBJECT
|
||||
@ -43,14 +40,12 @@ class DeviceViewContainer : public QWidget {
|
||||
explicit DeviceViewContainer(QWidget *parent = nullptr);
|
||||
~DeviceViewContainer();
|
||||
|
||||
DeviceView* view() const;
|
||||
DeviceView *view() const;
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *);
|
||||
|
||||
private:
|
||||
Ui::DeviceViewContainer *ui_;
|
||||
bool loaded_icons_;
|
||||
Ui_DeviceViewContainer *ui_;
|
||||
};
|
||||
|
||||
#endif // DEVICEVIEWCONTAINER_H
|
||||
|
@ -29,43 +29,6 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="windows_is_broken_frame">
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="warning_icon"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>iPods and USB devices currently don't work on Windows. Sorry!</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="close_frame_button"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="DeviceView" name="view" native="true">
|
||||
<property name="sizePolicy">
|
||||
@ -87,22 +50,5 @@
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>close_frame_button</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>windows_is_broken_frame</receiver>
|
||||
<slot>hide()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>362</x>
|
||||
<y>31</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>369</x>
|
||||
<y>40</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
Loading…
Reference in New Issue
Block a user