| 1 | #cxx . . $ `<file>/src/playlistwidget.cpp`/include "playlistwidget.h"cxx . . $ `<file>/src/playlistwidget.h`/ |
| 2 | #include "ui_playlistwidget.h"cxx . . $ `<file>/src/ui_playlistwidget.h`/ |
| 3 | |
| 4 | #include <QMouseEvent> |
| 5 | #include <QTimer> |
| 6 | #include <qdebug.h> |
| 7 | |
| 8 | class PlaylistWidgetPrivatecxx . . $ PlaylistWidgetPrivate# { |
| 9 | public: |
| 10 | QStringcxx . . $ QString# namecxx . . $ PlaylistWidgetPrivate#name.; |
| 11 | QStringcxx . . $ QString# descriptioncxx . . $ PlaylistWidgetPrivate#description.; |
| 12 | bool isActivecxx . . $ PlaylistWidgetPrivate#isActive.; |
| 13 | QTimercxx . . $ QTimer#* timerSlidecxx . . $ PlaylistWidgetPrivate#timerSlide.; |
| 14 | int targetWidthcxx . . $ PlaylistWidgetPrivate#targetWidth.; |
| 15 | bool isRemovablecxx . . $ PlaylistWidgetPrivate#isRemovable.; |
| 16 | }; |
| 17 | |
| 18 | PlaylistWidgetcxx . . $ PlaylistWidget#::PlaylistWidgetcxx . . $ PlaylistWidget#PlaylistWidget(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget#* parent) |
| 19 | : QWidgetcxx . . $ QWidget#QWidget(872e7b0c281abd8d).(parent) |
| 20 | , uicxx . . $ PlaylistWidget#ui.(new Uicxx . . $ Ui/::PlaylistWidgetcxx . . $ Ui/PlaylistWidget#) |
| 21 | { |
| 22 | uicxx . . $ PlaylistWidget#ui.->setupUicxx . . $ Ui_PlaylistWidget#setupUi(108f35f7aa7f3cf9).(this); |
| 23 | uicxx . . $ PlaylistWidget#ui.->lblDesciptioncxx . . $ Ui_PlaylistWidget#lblDesciption.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(QStringcxx . . $ QString#QString(ee6b7ef95d0103b6).::nullcxx . . $ QString#null.); |
| 24 | uicxx . . $ PlaylistWidget#ui.->widgetClosecxx . . $ Ui_PlaylistWidget#widgetClose.->setMinimumWidthcxx . . $ QWidget#setMinimumWidth(d4f767463ce0a6b3).(0); |
| 25 | uicxx . . $ PlaylistWidget#ui.->widgetClosecxx . . $ Ui_PlaylistWidget#widgetClose.->setMaximumWidthcxx . . $ QWidget#setMaximumWidth(d4f767463ce0a6b3).(0); |
| 26 | |
| 27 | setFocusPolicycxx . . $ QWidget#setFocusPolicy(84f385f4ea7c1696).(Qtcxx . . $ Qt/::ClickFocuscxx . . $ Qt/ClickFocus.); |
| 28 | |
| 29 | pcxx . . $ PlaylistWidget#p. = new PlaylistWidgetPrivatecxx . . $ PlaylistWidgetPrivate#; |
| 30 | pcxx . . $ PlaylistWidget#p.->isActivecxx . . $ PlaylistWidgetPrivate#isActive. = false; |
| 31 | pcxx . . $ PlaylistWidget#p.->isRemovablecxx . . $ PlaylistWidgetPrivate#isRemovable. = true; |
| 32 | |
| 33 | QFontcxx . . $ QFont# font = uicxx . . $ QFont#QFont(d0a4bd0c8524b912).->lblDesciptioncxx . . $ Ui_PlaylistWidget#lblDesciption.->fontcxx . . $ QWidget#font(c5040538afc47120).(); |
| 34 | #if defined(Q_OS_DARWIN) |
| 35 | int newSize = font.pointSize() - 4; |
| 36 | #else |
| 37 | int newSize = font.pointSizecxx . . $ QFont#pointSize(455f465bc33b4cdf).() - 1; |
| 38 | #endif |
| 39 | font.setPointSizecxx . . $ QFont#setPointSize(d4f767463ce0a6b3).(newSize); |
| 40 | uicxx . . $ PlaylistWidget#ui.->lblDesciptioncxx . . $ Ui_PlaylistWidget#lblDesciption.->setFontcxx . . $ QWidget#setFont(d0a4bd0c8524b912).(font); |
| 41 | |
| 42 | pcxx . . $ PlaylistWidget#p.->timerSlidecxx . . $ PlaylistWidgetPrivate#timerSlide. = new QTimercxx . . $ QTimer#QTimer(749de1b6ae65bddd).(this); |
| 43 | pcxx . . $ PlaylistWidget#p.->timerSlidecxx . . $ PlaylistWidgetPrivate#timerSlide.->setIntervalcxx . . $ QTimer#setInterval(d4f767463ce0a6b3).(10); |
| 44 | connectcxx . . $ QObject#connect(f4332061c7e4ca89).(pcxx . . $ PlaylistWidget#p.->timerSlidecxx . . $ PlaylistWidgetPrivate#timerSlide., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(timeout()), SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(timerSlide_timeOut())); |
| 45 | } |
| 46 | |
| 47 | PlaylistWidgetcxx . . $ PlaylistWidget#::~cxx . . $ PlaylistWidget#`~PlaylistWidget`(ced63f7c635d850d).PlaylistWidgetcxx . . $ PlaylistWidget#() |
| 48 | { |
| 49 | delete uicxx . . $ PlaylistWidget#ui.; |
| 50 | delete pcxx . . $ PlaylistWidget#p.; |
| 51 | } |
| 52 | |
| 53 | // auto connect slot |
| 54 | void PlaylistWidgetcxx . . $ PlaylistWidget#::on_lblName_linkActivatedcxx . . $ PlaylistWidget#on_lblName_linkActivated(3520e46b33348bf6).(const QStringcxx . . $ QString#& link) |
| 55 | { |
| 56 | Q_UNUSEDcxx . . $ `<external>/15045578679651060896/qglobal.h:117:9`!(link); |
| 57 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! activatedcxx . . $ PlaylistWidget#activated(49f6e7a06ebc5aa8).(); |
| 58 | } |
| 59 | |
| 60 | bool PlaylistWidgetcxx . . $ PlaylistWidget#::isRemovablecxx . . $ PlaylistWidget#isRemovable(c9857a73d68e59ba).() |
| 61 | { |
| 62 | return pcxx . . $ PlaylistWidget#p.->isRemovablecxx . . $ PlaylistWidgetPrivate#isRemovable.; |
| 63 | } |
| 64 | |
| 65 | void PlaylistWidgetcxx . . $ PlaylistWidget#::setRemovablecxx . . $ PlaylistWidget#setRemovable(b45ddcbc8423892c).(bool value) |
| 66 | { |
| 67 | pcxx . . $ PlaylistWidget#p.->isRemovablecxx . . $ PlaylistWidgetPrivate#isRemovable. = value; |
| 68 | uicxx . . $ PlaylistWidget#ui.->pushClosecxx . . $ Ui_PlaylistWidget#pushClose.->setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(value); |
| 69 | // if (!value) |
| 70 | // r ui->horizontalSpacer->changeSize(42,0); |
| 71 | } |
| 72 | |
| 73 | QStringcxx . . $ QString# |
| 74 | PlaylistWidgetcxx . . $ PlaylistWidget#::namecxx . . $ PlaylistWidget#name(4365c3963150523e).() |
| 75 | { |
| 76 | return pcxx . . $ QString#QString(132dd6869045752b).->namecxx . . $ PlaylistWidgetPrivate#name.; |
| 77 | } |
| 78 | |
| 79 | void PlaylistWidgetcxx . . $ PlaylistWidget#::setNamecxx . . $ PlaylistWidget#setName(7df51288a9ebd664).(QStringcxx . . $ QString# value) |
| 80 | { |
| 81 | pcxx . . $ PlaylistWidget#p.->namecxx . . $ PlaylistWidgetPrivate#name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). value; |
| 82 | updateViewcxx . . $ PlaylistWidget#updateView(49f6e7a06ebc5aa8).(); |
| 83 | } |
| 84 | |
| 85 | QStringcxx . . $ QString# |
| 86 | PlaylistWidgetcxx . . $ PlaylistWidget#::descriptioncxx . . $ PlaylistWidget#description(4365c3963150523e).() |
| 87 | { |
| 88 | return pcxx . . $ QString#QString(132dd6869045752b).->descriptioncxx . . $ PlaylistWidgetPrivate#description.; |
| 89 | } |
| 90 | |
| 91 | void PlaylistWidgetcxx . . $ PlaylistWidget#::setDescriptioncxx . . $ PlaylistWidget#setDescription(7df51288a9ebd664).(QStringcxx . . $ QString# value) |
| 92 | { |
| 93 | pcxx . . $ PlaylistWidget#p.->descriptioncxx . . $ PlaylistWidgetPrivate#description. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). value; |
| 94 | updateViewcxx . . $ PlaylistWidget#updateView(49f6e7a06ebc5aa8).(); |
| 95 | } |
| 96 | |
| 97 | void PlaylistWidgetcxx . . $ PlaylistWidget#::activatecxx . . $ PlaylistWidget#activate(49f6e7a06ebc5aa8).() |
| 98 | { |
| 99 | pcxx . . $ PlaylistWidget#p.->isActivecxx . . $ PlaylistWidgetPrivate#isActive. = true; |
| 100 | updateViewcxx . . $ PlaylistWidget#updateView(49f6e7a06ebc5aa8).(); |
| 101 | } |
| 102 | |
| 103 | void PlaylistWidgetcxx . . $ PlaylistWidget#::deactivatecxx . . $ PlaylistWidget#deactivate(49f6e7a06ebc5aa8).() |
| 104 | { |
| 105 | pcxx . . $ PlaylistWidget#p.->isActivecxx . . $ PlaylistWidgetPrivate#isActive. = false; |
| 106 | updateViewcxx . . $ PlaylistWidget#updateView(49f6e7a06ebc5aa8).(); |
| 107 | } |
| 108 | |
| 109 | void PlaylistWidgetcxx . . $ PlaylistWidget#::mousePressEventcxx . . $ PlaylistWidget#mousePressEvent(702858a82d06265c).(QMouseEventcxx . . $ QMouseEvent#* event) |
| 110 | { |
| 111 | if (uicxx . . $ PlaylistWidget#ui.->widgetClosecxx . . $ Ui_PlaylistWidget#widgetClose.->geometrycxx . . $ QWidget#geometry(f4023511c62cad66).().containscxx . . $ QRect#contains(eaee943b37977784).(event->poscxx . . $ QMouseEvent#pos(75d69cfbd3c4b2dd).())) { |
| 112 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! deletedcxx . . $ PlaylistWidget#deleted(49f6e7a06ebc5aa8).(); |
| 113 | } else { |
| 114 | slideCloseWidgetcxx . . $ PlaylistWidget#slideCloseWidget(b45ddcbc8423892c).(false); |
| 115 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! activatedcxx . . $ PlaylistWidget#activated(49f6e7a06ebc5aa8).(); |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | void PlaylistWidgetcxx . . $ PlaylistWidget#::updateViewcxx . . $ PlaylistWidget#updateView(49f6e7a06ebc5aa8).() |
| 120 | { |
| 121 | // update Labels |
| 122 | uicxx . . $ PlaylistWidget#ui.->lblDesciptioncxx . . $ Ui_PlaylistWidget#lblDesciption.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(pcxx . . $ PlaylistWidget#p.->descriptioncxx . . $ PlaylistWidgetPrivate#description.); |
| 123 | |
| 124 | // active/passive look differentiation |
| 125 | QStringcxx . . $ QString# activeStylecxx . . $ QString#QString(ced63f7c635d850d).; |
| 126 | if (pcxx . . $ PlaylistWidget#p.->isActivecxx . . $ PlaylistWidgetPrivate#isActive.) { |
| 127 | activeStyle =cxx . . $ QString#`operator=`(d02845eef0c33901). "color:#ff6464;'>"; |
| 128 | uicxx . . $ PlaylistWidget#ui.->framePlaylistWidgetcxx . . $ Ui_PlaylistWidget#framePlaylistWidget.->setStyleSheetcxx . . $ QWidget#setStyleSheet(3520e46b33348bf6).( |
| 129 | "#framePlaylistWidget { background: qlineargradient("cxx . . $ QString#QString(85c52e162fed56f9). |
| 130 | "x1:0, y1:0, x2:0, y2:1," |
| 131 | "stop: 0.01 #202020," |
| 132 | "stop:0.11 #505050," |
| 133 | "stop:1 #505050" |
| 134 | ");}"); |
| 135 | } else { |
| 136 | activeStyle =cxx . . $ QString#`operator=`(d02845eef0c33901). "color:#eeeeee;'>"; |
| 137 | uicxx . . $ PlaylistWidget#ui.->framePlaylistWidgetcxx . . $ Ui_PlaylistWidget#framePlaylistWidget.->setStyleSheetcxx . . $ QWidget#setStyleSheet(3520e46b33348bf6).( |
| 138 | "#framePlaylistWidget { background: qlineargradient("cxx . . $ QString#QString(85c52e162fed56f9). |
| 139 | "x1:0, y1:0, x2:0, y2:1," |
| 140 | "stop: 0.01 #202020," |
| 141 | "stop:0.11 #404040," |
| 142 | "stop:1 #404040" |
| 143 | ");}"); |
| 144 | } |
| 145 | |
| 146 | uicxx . . $ PlaylistWidget#ui.->lblNamecxx . . $ Ui_PlaylistWidget#lblName.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).( |
| 147 | "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN' " |
| 148 | "'http://www.w3.org/TR/REC-html40/strict.dtd'>" |
| 149 | "<html><head><meta name='qrichtext' content='1' /><style " |
| 150 | "type='text/css'>p, li { white-space: pre-wrap; }" |
| 151 | "</style></head><body style='font-size:8.25pt; font-weight:400; " |
| 152 | "font-style:normal;'><p style=' margin-top:0px; " |
| 153 | "margin-bottom:0px; margin-left:0px; margin-right:0px; " |
| 154 | "-qt-block-indent:0; text-indent:0px;'>" |
| 155 | "<a href='fdadfaf'><span style=' " |
| 156 | "font-size:12pt;font-style:normal;font-weight:bold; text-decoration: " |
| 157 | "underline; " |
| 158 | +cxx . . $ operator+(c75c3ae4eb9af1a8). activeStyle +cxx . . $ operator+(fab9b4f80031f353). pcxx . . $ PlaylistWidget#p.->namecxx . . $ PlaylistWidgetPrivate#name. +cxx . . $ operator+(3d22f08efddf8107). "</span></a></p></body></html>"); |
| 159 | } |
| 160 | |
| 161 | void PlaylistWidgetcxx . . $ PlaylistWidget#::on_butPlayWidget_pressedcxx . . $ PlaylistWidget#on_butPlayWidget_pressed(49f6e7a06ebc5aa8).() |
| 162 | { |
| 163 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! startedcxx . . $ PlaylistWidget#started(49f6e7a06ebc5aa8).(); |
| 164 | } |
| 165 | |
| 166 | // esc key for exit close |
| 167 | void PlaylistWidgetcxx . . $ PlaylistWidget#::keyPressEventcxx . . $ PlaylistWidget#keyPressEvent(c92999c1b6b09cc0).(QKeyEventcxx . . $ QKeyEvent#* e) |
| 168 | { |
| 169 | if (e->keycxx . . $ QKeyEvent#key(455f465bc33b4cdf).() == Qtcxx . . $ Qt/::Key_Escapecxx . . $ Qt/Key_Escape.) |
| 170 | slideCloseWidgetcxx . . $ PlaylistWidget#slideCloseWidget(b45ddcbc8423892c).(false); |
| 171 | else |
| 172 | QWidgetcxx . . $ QWidget#::keyPressEventcxx . . $ QWidget#keyPressEvent(c92999c1b6b09cc0).(e); |
| 173 | } |
| 174 | |
| 175 | void PlaylistWidgetcxx . . $ PlaylistWidget#::on_pushClose_clickedcxx . . $ PlaylistWidget#on_pushClose_clicked(49f6e7a06ebc5aa8).() |
| 176 | { |
| 177 | slideCloseWidgetcxx . . $ PlaylistWidget#slideCloseWidget(b45ddcbc8423892c).((uicxx . . $ PlaylistWidget#ui.->widgetClosecxx . . $ Ui_PlaylistWidget#widgetClose.->minimumWidthcxx . . $ QWidget#minimumWidth(455f465bc33b4cdf).() < 50)); |
| 178 | } |
| 179 | |
| 180 | void PlaylistWidgetcxx . . $ PlaylistWidget#::slideCloseWidgetcxx . . $ PlaylistWidget#slideCloseWidget(b45ddcbc8423892c).(bool open) |
| 181 | { |
| 182 | pcxx . . $ PlaylistWidget#p.->targetWidthcxx . . $ PlaylistWidgetPrivate#targetWidth. = (open) ? 70 : 0; |
| 183 | pcxx . . $ PlaylistWidget#p.->timerSlidecxx . . $ PlaylistWidgetPrivate#timerSlide.->startcxx . . $ QTimer#start(49f6e7a06ebc5aa8).(); |
| 184 | } |
| 185 | |
| 186 | void PlaylistWidgetcxx . . $ PlaylistWidget#::timerSlide_timeOutcxx . . $ PlaylistWidget#timerSlide_timeOut(49f6e7a06ebc5aa8).() |
| 187 | { |
| 188 | int mWidth = uicxx . . $ PlaylistWidget#ui.->widgetClosecxx . . $ Ui_PlaylistWidget#widgetClose.->minimumWidthcxx . . $ QWidget#minimumWidth(455f465bc33b4cdf).(); |
| 189 | if (pcxx . . $ PlaylistWidget#p.->targetWidthcxx . . $ PlaylistWidgetPrivate#targetWidth. > mWidth) { |
| 190 | uicxx . . $ PlaylistWidget#ui.->widgetClosecxx . . $ Ui_PlaylistWidget#widgetClose.->setMinimumWidthcxx . . $ QWidget#setMinimumWidth(d4f767463ce0a6b3).(mWidth + 5); |
| 191 | uicxx . . $ PlaylistWidget#ui.->widgetClosecxx . . $ Ui_PlaylistWidget#widgetClose.->setMaximumWidthcxx . . $ QWidget#setMaximumWidth(d4f767463ce0a6b3).(mWidth + 5); |
| 192 | } else if (pcxx . . $ PlaylistWidget#p.->targetWidthcxx . . $ PlaylistWidgetPrivate#targetWidth. < mWidth) { |
| 193 | uicxx . . $ PlaylistWidget#ui.->widgetClosecxx . . $ Ui_PlaylistWidget#widgetClose.->setMinimumWidthcxx . . $ QWidget#setMinimumWidth(d4f767463ce0a6b3).(mWidth - 5); |
| 194 | uicxx . . $ PlaylistWidget#ui.->widgetClosecxx . . $ Ui_PlaylistWidget#widgetClose.->setMaximumWidthcxx . . $ QWidget#setMaximumWidth(d4f767463ce0a6b3).(mWidth - 5); |
| 195 | } else { |
| 196 | pcxx . . $ PlaylistWidget#p.->timerSlidecxx . . $ PlaylistWidgetPrivate#timerSlide.->stopcxx . . $ QTimer#stop(49f6e7a06ebc5aa8).(); |
| 197 | } |
| 198 | } |