Rename AutoSizedTextEdit to SongInfoTextView
This commit is contained in:
parent
07f181cc2b
commit
efb84a25ce
@ -140,6 +140,7 @@ set(SOURCES
|
||||
songinfo/songinfobase.cpp
|
||||
songinfo/songinfofetcher.cpp
|
||||
songinfo/songinfoprovider.cpp
|
||||
songinfo/songinfotextview.cpp
|
||||
songinfo/songinfoview.cpp
|
||||
songinfo/songplaystats.cpp
|
||||
songinfo/tagwidget.cpp
|
||||
@ -166,7 +167,6 @@ set(SOURCES
|
||||
ui/systemtrayicon.cpp
|
||||
|
||||
widgets/autoexpandingtreeview.cpp
|
||||
widgets/autosizedtextedit.cpp
|
||||
widgets/busyindicator.cpp
|
||||
widgets/elidedlabel.cpp
|
||||
widgets/equalizerslider.cpp
|
||||
@ -288,6 +288,7 @@ set(HEADERS
|
||||
songinfo/songinfobase.h
|
||||
songinfo/songinfofetcher.h
|
||||
songinfo/songinfoprovider.h
|
||||
songinfo/songinfotextview.h
|
||||
songinfo/songinfoview.h
|
||||
songinfo/songplaystats.h
|
||||
songinfo/tagwidget.h
|
||||
@ -311,7 +312,6 @@ set(HEADERS
|
||||
ui/systemtrayicon.h
|
||||
|
||||
widgets/autoexpandingtreeview.h
|
||||
widgets/autosizedtextedit.h
|
||||
widgets/busyindicator.h
|
||||
widgets/elidedlabel.h
|
||||
widgets/equalizerslider.h
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
#include "echonestbiographies.h"
|
||||
#include "widgets/autosizedtextedit.h"
|
||||
#include "songinfotextview.h"
|
||||
|
||||
#include <echonest/Artist.h>
|
||||
|
||||
@ -86,7 +86,7 @@ void EchoNestBiographies::RequestFinished() {
|
||||
if (site_icons_.contains(canonical_site))
|
||||
data.icon_ = site_icons_[canonical_site];
|
||||
|
||||
AutoSizedTextEdit* editor = new AutoSizedTextEdit;
|
||||
SongInfoTextView* editor = new SongInfoTextView;
|
||||
editor->setHtml(bio.text());
|
||||
data.contents_ = editor;
|
||||
|
||||
|
@ -15,10 +15,10 @@
|
||||
*/
|
||||
|
||||
#include "lastfmtrackinfoprovider.h"
|
||||
#include "songinfotextview.h"
|
||||
#include "songplaystats.h"
|
||||
#include "tagwidget.h"
|
||||
#include "ui/iconloader.h"
|
||||
#include "widgets/autosizedtextedit.h"
|
||||
|
||||
#include <lastfm/ws.h>
|
||||
#include <lastfm/XmlQuery>
|
||||
@ -119,7 +119,7 @@ void LastfmTrackInfoProvider::GetWiki(int id, const lastfm::XmlQuery& q) {
|
||||
data.type_ = CollapsibleInfoPane::Data::Type_Biography;
|
||||
data.icon_ = QIcon(":/last.fm/as.png");
|
||||
|
||||
AutoSizedTextEdit* widget = new AutoSizedTextEdit;
|
||||
SongInfoTextView* widget = new SongInfoTextView;
|
||||
data.contents_ = widget;
|
||||
|
||||
widget->setHtml(content);
|
||||
|
@ -14,16 +14,16 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "autosizedtextedit.h"
|
||||
#include "songinfotextview.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QSettings>
|
||||
#include <QWheelEvent>
|
||||
|
||||
const qreal AutoSizedTextEdit::kDefaultFontSize = 8.5;
|
||||
const char* AutoSizedTextEdit::kSettingsGroup = "SongInfo";
|
||||
const qreal SongInfoTextView::kDefaultFontSize = 8.5;
|
||||
const char* SongInfoTextView::kSettingsGroup = "SongInfo";
|
||||
|
||||
AutoSizedTextEdit::AutoSizedTextEdit(QWidget* parent)
|
||||
SongInfoTextView::SongInfoTextView(QWidget* parent)
|
||||
: QTextBrowser(parent),
|
||||
last_width_(-1)
|
||||
{
|
||||
@ -34,7 +34,7 @@ AutoSizedTextEdit::AutoSizedTextEdit(QWidget* parent)
|
||||
ReloadSettings();
|
||||
}
|
||||
|
||||
void AutoSizedTextEdit::ReloadSettings() {
|
||||
void SongInfoTextView::ReloadSettings() {
|
||||
QSettings s;
|
||||
s.beginGroup(kSettingsGroup);
|
||||
|
||||
@ -44,7 +44,7 @@ void AutoSizedTextEdit::ReloadSettings() {
|
||||
document()->setDefaultFont(font);
|
||||
}
|
||||
|
||||
void AutoSizedTextEdit::resizeEvent(QResizeEvent* e) {
|
||||
void SongInfoTextView::resizeEvent(QResizeEvent* e) {
|
||||
const int w = qMax(100, width());
|
||||
if (w == last_width_)
|
||||
return;
|
||||
@ -56,10 +56,10 @@ void AutoSizedTextEdit::resizeEvent(QResizeEvent* e) {
|
||||
QTextEdit::resizeEvent(e);
|
||||
}
|
||||
|
||||
QSize AutoSizedTextEdit::sizeHint() const {
|
||||
QSize SongInfoTextView::sizeHint() const {
|
||||
return minimumSize();
|
||||
}
|
||||
|
||||
void AutoSizedTextEdit::wheelEvent(QWheelEvent* e) {
|
||||
void SongInfoTextView::wheelEvent(QWheelEvent* e) {
|
||||
e->ignore();
|
||||
}
|
@ -14,16 +14,16 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef AUTOSIZEDTEXTEDIT_H
|
||||
#define AUTOSIZEDTEXTEDIT_H
|
||||
#ifndef SONGINFOTEXTVIEW_H
|
||||
#define SONGINFOTEXTVIEW_H
|
||||
|
||||
#include <QTextBrowser>
|
||||
|
||||
class AutoSizedTextEdit : public QTextBrowser {
|
||||
class SongInfoTextView : public QTextBrowser {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AutoSizedTextEdit(QWidget* parent = 0);
|
||||
SongInfoTextView(QWidget* parent = 0);
|
||||
|
||||
static const qreal kDefaultFontSize;
|
||||
static const char* kSettingsGroup;
|
||||
@ -41,4 +41,4 @@ private:
|
||||
int last_width_;
|
||||
};
|
||||
|
||||
#endif // AUTOSIZEDTEXTEDIT_H
|
||||
#endif // SONGINFOTEXTVIEW_H
|
@ -14,9 +14,9 @@
|
||||
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "songinfotextview.h"
|
||||
#include "ultimatelyricsprovider.h"
|
||||
#include "core/networkaccessmanager.h"
|
||||
#include "widgets/autosizedtextedit.h"
|
||||
|
||||
#include <QNetworkReply>
|
||||
#include <QTextCodec>
|
||||
@ -121,7 +121,7 @@ void UltimateLyricsProvider::LyricsFetched(quint64 id, QNetworkReply* reply) {
|
||||
data.type_ = CollapsibleInfoPane::Data::Type_Lyrics;
|
||||
data.relevance_ = relevance();
|
||||
|
||||
AutoSizedTextEdit* editor = new AutoSizedTextEdit;
|
||||
SongInfoTextView* editor = new SongInfoTextView;
|
||||
editor->setHtml(lyrics);
|
||||
data.contents_ = editor;
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "ui_settingsdialog.h"
|
||||
#include "engines/enginebase.h"
|
||||
#include "playlist/playlistview.h"
|
||||
#include "widgets/autosizedtextedit.h"
|
||||
#include "songinfo/songinfotextview.h"
|
||||
#include "widgets/osd.h"
|
||||
#include "widgets/osdpretty.h"
|
||||
|
||||
@ -243,7 +243,7 @@ void SettingsDialog::accept() {
|
||||
#endif
|
||||
|
||||
// Song info
|
||||
s.beginGroup(AutoSizedTextEdit::kSettingsGroup);
|
||||
s.beginGroup(SongInfoTextView::kSettingsGroup);
|
||||
s.setValue("font_size", ui_->song_info_font_preview->font().pointSizeF());
|
||||
s.endGroup();
|
||||
|
||||
@ -337,9 +337,9 @@ void SettingsDialog::showEvent(QShowEvent*) {
|
||||
s.endGroup();
|
||||
|
||||
// Song Info
|
||||
s.beginGroup(AutoSizedTextEdit::kSettingsGroup);
|
||||
s.beginGroup(SongInfoTextView::kSettingsGroup);
|
||||
ui_->song_info_font_size->setValue(
|
||||
s.value("font_size", AutoSizedTextEdit::kDefaultFontSize).toReal());
|
||||
s.value("font_size", SongInfoTextView::kDefaultFontSize).toReal());
|
||||
s.endGroup();
|
||||
|
||||
ui_->lyric_settings->Load();
|
||||
|
Loading…
x
Reference in New Issue
Block a user