Commit be614df5 authored by Scott Wheeler's avatar Scott Wheeler

Ok, added some fixes to make the "left most column" => "left most *visible*

column"

svn path=/trunk/kdemultimedia/juk/; revision=213202
parent b44e56d5
......@@ -422,6 +422,14 @@ void Playlist::hideColumn(int c)
setColumnWidth(c, 0);
setResizeMode(QListView::LastColumn);
triggerUpdate();
if(c == m_leftColumn) {
if(m_playingItem) {
m_playingItem->setPixmap(m_leftColumn, QPixmap(0, 0));
m_playingItem->setPixmap(leftMostVisibleColumn(), QPixmap(UserIcon("playing")));
}
m_leftColumn = leftMostVisibleColumn();
}
}
void Playlist::showColumn(int c)
......@@ -437,14 +445,19 @@ void Playlist::showColumn(int c)
setColumnWidth(c, w);
triggerUpdate();
if(c == leftMostVisibleColumn()) {
if(m_playingItem) {
m_playingItem->setPixmap(m_leftColumn, QPixmap(0, 0));
m_playingItem->setPixmap(leftMostVisibleColumn(), QPixmap(UserIcon("playing")));
}
m_leftColumn = leftMostVisibleColumn();
}
}
bool Playlist::isColumnVisible(int c) const
{
if(columnWidth(c) != 0)
return true;
else
return false;
return columnWidth(c) != 0;
}
QString Playlist::resolveSymLinks(const QFileInfo &file)
......@@ -690,6 +703,14 @@ void Playlist::slotColumnOrderChanged(int, int from, int to)
}
}
int Playlist::leftMostVisibleColumn() const
{
int i = 0;
while(!isColumnVisible(header()->mapToSection(i)) && i < PlaylistItem::lastColumn())
i++;
return header()->mapToSection(i);
}
////////////////////////////////////////////////////////////////////////////////
// helper functions
......
......@@ -191,7 +191,7 @@ signals:
private:
void setup();
void applyTag(QListViewItem *item, const QString &text, int column);
QPtrStack<PlaylistItem> m_history;
int leftMostVisibleColumn() const;
private slots:
void slotEmitSelected() { emit signalSelectionChanged(selectedItems()); }
......@@ -206,6 +206,7 @@ private:
SortedStringList m_members;
int m_processed;
bool m_allowDuplicates;
QPtrStack<PlaylistItem> m_history;
QString m_playlistFileName;
......
......@@ -61,6 +61,8 @@ public:
enum ColumnType { TrackColumn = 0, ArtistColumn = 1, AlbumColumn = 2, TrackNumberColumn = 3,
GenreColumn = 4, YearColumn = 5, LengthColumn = 6, FileNameColumn = 7 };
static const int lastColumn() { return FileNameColumn; }
void setFile(const QString &file);
Tag *tag() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment