Commit 26b1035f authored by Michael Pyne's avatar Michael Pyne

Implement bug 73435 (Add option for manual column widths). Due to a...

Implement bug 73435 (Add option for manual column widths).  Due to a limitation in QListViews, hiding columns doesn't work too well in this mode, which you'll probably encounter while resizing columns next to hidden columns.

If I manage to hack around this limitation enough I'll close the bug I guess.

I think we need a Config dialog now, right now you can switch between Manual and Automatic Resizing in the view menu.

CCMAIL:73435@bugs.kde.org

svn path=/trunk/kdemultimedia/juk/; revision=347542
parent 23b7b07a
......@@ -133,6 +133,10 @@ void JuK::setupActions()
new KToolBarPopupAction(i18n("Previous &Track"), "player_start", KShortcut(), m_player, SLOT(back()), actions(), "back");
new KAction(i18n("&Next Track"), "player_end", KShortcut(), m_player, SLOT(forward()), actions(), "forward");
new KToggleAction(i18n("&Loop Playlist"), 0, KShortcut(), actions(), "loopPlaylist");
KToggleAction *resizeColumnAction =
new KToggleAction(i18n("&Resize Column Headers Manually"),
KShortcut(), actions(), "resizeColumnsManually");
resizeColumnAction->setCheckedState(i18n("&Resize Column Headers Automatically"));
// the following are not visible by default
......
<!DOCTYPE kpartgui>
<kpartgui name="juk" version="6">
<kpartgui name="juk" version="7">
<MenuBar>
<Menu name="file" noMerge="1"><text>&amp;File</text>
<Action name="file_new"/>
......@@ -29,6 +29,7 @@
<Action name="showHistory"/>
<Action name="showUpcoming"/>
<Action name="showColumns"/>
<Action name="resizeColumnsManually"/>
<Separator/>
......
<!-- PLEASE UPDATE jukui-rtl.rc WHEN UPDATING THIS FILE -->
<!DOCTYPE kpartgui>
<kpartgui name="juk" version="6">
<kpartgui name="juk" version="7">
<MenuBar>
<Menu name="file" noMerge="1"><text>&amp;File</text>
<Action name="file_new"/>
......@@ -31,6 +31,7 @@
<Action name="showHistory"/>
<Action name="showUpcoming"/>
<Action name="showColumns"/>
<Action name="resizeColumnsManually"/>
<Separator/>
......
......@@ -208,6 +208,9 @@ Playlist::SharedSettings::SharedSettings()
{
KConfigGroup config(KGlobal::config(), "PlaylistShared");
bool resizeColumnsManually = config.readBoolEntry("ResizeColumnsManually", false);
action<KToggleAction>("resizeColumnsManually")->setChecked(resizeColumnsManually);
// save column order
m_columnOrder = config.readIntListEntry("ColumnOrder");
......@@ -263,6 +266,9 @@ void Playlist::SharedSettings::writeConfig()
config.writeEntry("VisibleColumns", l);
config.writeEntry("InlineCompletionMode", m_inlineCompletion);
bool resizeColumnsManually = ActionCollection::action<KToggleAction>("resizeColumnsManually")->isChecked();
config.writeEntry("ResizeColumnsManually", resizeColumnsManually);
KGlobal::config()->sync();
}
......@@ -819,7 +825,8 @@ bool Playlist::eventFilter(QObject *watched, QEvent *e)
}
case QEvent::MouseButtonRelease:
{
if(m_widthsDirty)
KToggleAction *manualResize = action<KToggleAction>("resizeColumnsManually");
if(manualResize && !manualResize->isChecked() && m_widthsDirty)
QTimer::singleShot(0, this, SLOT(slotUpdateColumnWidths()));
break;
}
......
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