F9 and F10 hotkeys to hide daily panel sidebar and calendar

This commit is contained in:
Mark Watkins 2014-08-05 07:28:27 +10:00
parent 754b79b096
commit 592b6c271b
9 changed files with 69 additions and 4 deletions

2
configure vendored
View File

@ -23,4 +23,4 @@ if [[ -z ${QMAKE} ]]; then
fi
# Finally, configure the build.
qmake-qt5 "${DIR}"
${QMAKE} "${DIR}"

View File

@ -1876,7 +1876,7 @@ void gGraphView::keyPressEvent(QKeyEvent *event)
p_profile->appearance->setLineCursorMode(!p_profile->appearance->lineCursorMode());
timedRedraw(0);
}
if (event->key() == Qt::Key_F10) {
if ((event->key() == Qt::Key_F10) && (event->modifiers() == Qt::ShiftModifier)) {
dumpInfo();
}

View File

@ -1 +1 @@
const int build_number = 7;
const int build_number = 8;

View File

@ -51,6 +51,23 @@ inline QString channelInfo(ChannelID code) {
return schema::channel[code].fullname()+"\n"+schema::channel[code].description()+"\n("+schema::channel[code].units()+")";
}
void Daily::setCalendarVisible(bool visible)
{
on_calButton_toggled(visible);
}
void Daily::setSidebarVisible(bool visible)
{
QList<int> a;
int panel_width = visible ? 350 : 0;
a.push_back(panel_width);
a.push_back(this->width() - panel_width);
ui->splitter_2->setStretchFactor(1,1);
ui->splitter_2->setSizes(a);
ui->splitter_2->setStretchFactor(1,1);
}
Daily::Daily(QWidget *parent,gGraphView * shared)
:QWidget(parent), ui(new Ui::Daily)
{

View File

@ -139,6 +139,10 @@ public:
*/
void Unload(QDate date=QDate());
void setSidebarVisible(bool visible);
void setCalendarVisible(bool visible);
private slots:
/*! \fn on_calendar_currentPageChanged(int year, int month);

View File

@ -2495,3 +2495,13 @@ void MainWindow::on_actionToggle_Line_Cursor_toggled(bool b)
getOverview()->graphView()->timedRedraw(0);
}
}
void MainWindow::on_actionLeft_Daily_Sidebar_toggled(bool visible)
{
getDaily()->setSidebarVisible(visible);
}
void MainWindow::on_actionDaily_Calendar_toggled(bool visible)
{
getDaily()->setCalendarVisible(visible);
}

View File

@ -323,6 +323,10 @@ class MainWindow : public QMainWindow
void on_actionToggle_Line_Cursor_toggled(bool arg1);
void on_actionLeft_Daily_Sidebar_toggled(bool arg1);
void on_actionDaily_Calendar_toggled(bool arg1);
private:
void importCPAPBackups();
void finishCPAPImport();

View File

@ -3163,6 +3163,8 @@ border-radius: 10px;
<addaction name="separator"/>
<addaction name="actionToggle_Line_Cursor"/>
<addaction name="action_Sidebar_Toggle"/>
<addaction name="actionLeft_Daily_Sidebar"/>
<addaction name="actionDaily_Calendar"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
@ -3481,6 +3483,34 @@ border-radius: 10px;
<string> </string>
</property>
</action>
<action name="actionLeft_Daily_Sidebar">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>Daily Sidebar</string>
</property>
<property name="shortcut">
<string>F9</string>
</property>
</action>
<action name="actionDaily_Calendar">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>Daily Calendar</string>
</property>
<property name="shortcut">
<string>F10</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

View File

@ -1 +1 @@
7
8