Skip to content

Commit

Permalink
minor revision and zoom cursor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmattkc committed Mar 8, 2019
1 parent 125f24a commit d294fef
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 97 deletions.
8 changes: 4 additions & 4 deletions io/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Config::Config()
waveform_resolution(64),
thumbnail_resolution(120),
add_default_effects_to_clips(true),
horizontal_timeline_scroll(true)
invert_timeline_scroll_axes(true)
{}

void Config::load(QString path) {
Expand All @@ -88,9 +88,9 @@ void Config::load(QString path) {
} else if (stream.name() == "ScrollZooms") {
stream.readNext();
scroll_zooms = (stream.text() == "1");
} else if (stream.name() == "HorizontalTimelineScroll") {
} else if (stream.name() == "InvertTimelineScrollAxes") {
stream.readNext();
horizontal_timeline_scroll = (stream.text() == "1");
invert_timeline_scroll_axes = (stream.text() == "1");
} else if (stream.name() == "EditToolSelectsLinks") {
stream.readNext();
edit_tool_selects_links = (stream.text() == "1");
Expand Down Expand Up @@ -237,7 +237,7 @@ void Config::save(QString path) {
stream.writeTextElement("Version", QString::number(olive::kSaveVersion));
stream.writeTextElement("ShowTrackLines", QString::number(show_track_lines));
stream.writeTextElement("ScrollZooms", QString::number(scroll_zooms));
stream.writeTextElement("HorizontalTimelineScroll", QString::number(horizontal_timeline_scroll));
stream.writeTextElement("InvertTimelineScrollAxes", QString::number(invert_timeline_scroll_axes));
stream.writeTextElement("EditToolSelectsLinks", QString::number(edit_tool_selects_links));
stream.writeTextElement("EditToolAlsoSeeks", QString::number(edit_tool_also_seeks));
stream.writeTextElement("SelectAlsoSeeks", QString::number(select_also_seeks));
Expand Down
7 changes: 3 additions & 4 deletions io/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,11 @@ struct Config {
bool add_default_effects_to_clips;

/**
* @brief Horizontal timeline scroll
* @brief Invert Timeline scroll axes
*
* **TRUE** Scrolling vertically with a mouse wheel or touchpad scrolls the Timeline horizontally.
* The Shift key temporarily toggles this setting.
* **TRUE** if scrolling vertically on the Timeline should scroll it horizontally
*/
bool horizontal_timeline_scroll;
bool invert_timeline_scroll_axes;

/**
* @brief Load config from file
Expand Down
16 changes: 9 additions & 7 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ MainWindow* olive::MainWindow;

#define DEFAULT_CSS "QPushButton::checked { background: rgb(25, 25, 25); }"

void MainWindow::setup_layout(bool reset) {
void MainWindow::setup_layout(bool reset) {
// load panels from file
if (!reset) {
QFile panel_config(get_config_dir().filePath("layout"));
Expand Down Expand Up @@ -652,6 +652,7 @@ void MainWindow::setup_menus() {
// INITIALIZE TOOLS MENU

tools_menu = MenuHelper::create_submenu(menuBar, this, SLOT(toolMenu_About_To_Be_Shown()));
tools_menu->setToolTipsVisible(true);

pointer_tool_action = MenuHelper::create_menu_action(tools_menu, "pointertool", &olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("V"));
pointer_tool_action->setCheckable(true);
Expand Down Expand Up @@ -717,9 +718,9 @@ void MainWindow::setup_menus() {
scroll_wheel_zooms->setCheckable(true);
scroll_wheel_zooms->setData(reinterpret_cast<quintptr>(&olive::CurrentConfig.scroll_zooms));

horizontal_timeline_scroll = MenuHelper::create_menu_action(tools_menu, "horizontaltimelinescroll", &olive::MenuHelper, SLOT(toggle_bool_action()));
horizontal_timeline_scroll->setCheckable(true);
horizontal_timeline_scroll->setData(reinterpret_cast<quintptr>(&olive::CurrentConfig.horizontal_timeline_scroll));
invert_timeline_scroll_axes = MenuHelper::create_menu_action(tools_menu, "inverttimelinescrollaxes", &olive::MenuHelper, SLOT(toggle_bool_action()));
invert_timeline_scroll_axes->setCheckable(true);
invert_timeline_scroll_axes->setData(reinterpret_cast<quintptr>(&olive::CurrentConfig.invert_timeline_scroll_axes));

enable_drag_files_to_timeline = MenuHelper::create_menu_action(tools_menu, "enabledragfilestotimeline", &olive::MenuHelper, SLOT(toggle_bool_action()));
enable_drag_files_to_timeline->setCheckable(true);
Expand Down Expand Up @@ -885,8 +886,9 @@ void MainWindow::Retranslate()
edit_tool_selects_links->setText(tr("Edit Tool Selects Links"));
seek_also_selects->setText(tr("Seek Also Selects"));
seek_to_end_of_pastes->setText(tr("Seek to the End of Pastes"));
scroll_wheel_zooms->setText(tr("Scroll Wheel Zooms (Ctrl toggles)"));
horizontal_timeline_scroll->setText(tr("Invert Timeline scroll axes"));
scroll_wheel_zooms->setText(tr("Scroll Wheel Zooms"));
scroll_wheel_zooms->setToolTip(tr("Hold CTRL to toggle this setting"));
invert_timeline_scroll_axes->setText(tr("Invert Timeline Scroll Axes"));
enable_drag_files_to_timeline->setText(tr("Enable Drag Files to Timeline"));
autoscale_by_default->setText(tr("Auto-Scale By Default"));
enable_seek_to_import->setText(tr("Enable Seek to Import"));
Expand Down Expand Up @@ -1139,7 +1141,7 @@ void MainWindow::toolMenu_About_To_Be_Shown() {
olive::MenuHelper.set_bool_action_checked(edit_tool_selects_links);
olive::MenuHelper.set_bool_action_checked(seek_to_end_of_pastes);
olive::MenuHelper.set_bool_action_checked(scroll_wheel_zooms);
olive::MenuHelper.set_bool_action_checked(horizontal_timeline_scroll);
olive::MenuHelper.set_bool_action_checked(invert_timeline_scroll_axes);
olive::MenuHelper.set_bool_action_checked(rectified_waveforms);
olive::MenuHelper.set_bool_action_checked(enable_drag_files_to_timeline);
olive::MenuHelper.set_bool_action_checked(autoscale_by_default);
Expand Down
2 changes: 1 addition & 1 deletion mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ private slots:
QAction* edit_tool_selects_links;
QAction* seek_to_end_of_pastes;
QAction* scroll_wheel_zooms;
QAction* horizontal_timeline_scroll;
QAction* invert_timeline_scroll_axes;
QAction* rectified_waveforms;
QAction* enable_drag_files_to_timeline;
QAction* autoscale_by_default;
Expand Down
Loading

0 comments on commit d294fef

Please sign in to comment.