diff --git a/YACReader/shortcuts_dialog.cpp b/YACReader/shortcuts_dialog.cpp index 8c7fe908..dd7441cf 100644 --- a/YACReader/shortcuts_dialog.cpp +++ b/YACReader/shortcuts_dialog.cpp @@ -51,7 +51,7 @@ ShortcutsDialog::ShortcutsDialog(QWidget * parent) setLayout(imgMainLayout); - setFixedSize(QSize(700,500)); + setFixedSize(QSize(700,500)); QFile f(":/files/shortcuts.html"); f.open(QIODevice::ReadOnly); diff --git a/shortcuts_management/actions_shortcuts_model.cpp b/shortcuts_management/actions_shortcuts_model.cpp index 0a9760d1..14ed0346 100644 --- a/shortcuts_management/actions_shortcuts_model.cpp +++ b/shortcuts_management/actions_shortcuts_model.cpp @@ -63,7 +63,7 @@ QVariant ActionsShortcutsModel::data(const QModelIndex &index, int role) const if (index.column() == NAME) return QVariant(actions[index.row()]->toolTip()); if (index.column() == KEYS) - return QVariant(actions[index.row()]->shortcut().toString()); + return QVariant(actions[index.row()]->shortcut().toString(QKeySequence::NativeText)); return QVariant(); } diff --git a/shortcuts_management/edit_shortcut_item_delegate.cpp b/shortcuts_management/edit_shortcut_item_delegate.cpp index 5b7d3627..4c10b11a 100644 --- a/shortcuts_management/edit_shortcut_item_delegate.cpp +++ b/shortcuts_management/edit_shortcut_item_delegate.cpp @@ -75,15 +75,15 @@ KeySequenceLineEdit::KeySequenceLineEdit(QWidget *parent) connect(acceptButton, SIGNAL(clicked()), this, SIGNAL(editingFinished())); } -void KeySequenceLineEdit::resizeEvent(QResizeEvent *) +void KeySequenceLineEdit::resizeEvent(QResizeEvent * e) { QSize szClear = clearButton->sizeHint(); //int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); int leftMargin = style()->pixelMetric(QStyle::PM_LayoutLeftMargin); int topMargin = style()->pixelMetric(QStyle::PM_LayoutTopMargin); - clearButton->move(0 + leftMargin,topMargin-4); + clearButton->move(0 + leftMargin,(e->size().height()-19)/2); //16 is the icon height+1blank pixel - acceptButton->move( leftMargin + szClear.width(),topMargin-4); + acceptButton->move( leftMargin + szClear.width(),(e->size().height()-19)/2); } diff --git a/shortcuts_management/edit_shortcuts_dialog.cpp b/shortcuts_management/edit_shortcuts_dialog.cpp index 3ae1e7e1..cd8bdc5c 100644 --- a/shortcuts_management/edit_shortcuts_dialog.cpp +++ b/shortcuts_management/edit_shortcuts_dialog.cpp @@ -18,7 +18,7 @@ EditShortcutsDialog::EditShortcutsDialog(QWidget *parent) : QDialog(parent) { QPushButton * resetButton = new QPushButton(tr("Restore defaults"),this); - QLabel * infoLabel = new QLabel(tr("To change a shortcut, select it, click in the key combination and type the new keys.")); + QLabel * infoLabel = new QLabel(tr("To change a shortcut, double click in the key combination and type the new keys.")); QVBoxLayout * layout = new QVBoxLayout(this); QSplitter * splitter = new QSplitter(this); actionsGroupsListView = new QListView(this); @@ -42,7 +42,8 @@ EditShortcutsDialog::EditShortcutsDialog(QWidget *parent) : actionsGroupsListView->setModel(groupsModel); actionsTableView->setModel(actionsModel); actionsTableView->setColumnWidth(0,30); - actionsTableView->setColumnWidth(1,270); + actionsTableView->setColumnWidth(1,360); + //actionsTableView->horizontalHeader()->sectionResizeMode(QHeaderView::Custom); actionsTableView->horizontalHeader()->setStretchLastSection(true); actionsTableView->setSelectionBehavior(QAbstractItemView::SelectRows); actionsTableView->setShowGrid(false); @@ -58,7 +59,11 @@ EditShortcutsDialog::EditShortcutsDialog(QWidget *parent) : connect(resetButton,SIGNAL(clicked()),this,SLOT(resetToDefaults())); connect(actionsGroupsListView->selectionModel(),SIGNAL(currentChanged(QModelIndex,QModelIndex)),this,SLOT(loadShortcuts(QModelIndex,QModelIndex))); //clicked(QModelIndex) doesn't work :S - setFixedSize(640,480); +#ifdef Q_OS_MAC + setFixedSize(760,500); +#else + setFixedSize(804,500); //extra width for modifiers +#endif setWindowTitle(tr("Shortcuts settings")); setModal(true); @@ -79,4 +84,5 @@ void EditShortcutsDialog::resetToDefaults() void EditShortcutsDialog::loadShortcuts(const QModelIndex &mi,const QModelIndex &mi2) { actionsModel->addActions(groupsModel->getActions(mi)); + //actionsTableView->resizeColumnsToContents(); }