format: reformatting files

This commit is contained in:
2026-07-13 15:30:43 +08:00
parent 7522543c48
commit e5eeaddf2f
511 changed files with 274803 additions and 207140 deletions
+6 -6
View File
@@ -17,10 +17,10 @@
add_subdirectory(tabs)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
dialog/preferences/keysequenceeditor.h
dialog/preferences/keysequenceeditor.cpp
dialog/preferences/preferences.h
dialog/preferences/preferences.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
dialog/preferences/keysequenceeditor.h
dialog/preferences/keysequenceeditor.cpp
dialog/preferences/preferences.h
dialog/preferences/preferences.cpp
PARENT_SCOPE
)
+9 -6
View File
@@ -46,16 +46,19 @@ PreferencesDialog::PreferencesDialog(MainWindow *main_window, int start_tab)
AddTab(new PreferencesGeneralTab(), tr("General"));
AddTab(new PreferencesAppearanceTab(), tr("Appearance"));
AddTab(new PreferencesAudioTab(), tr("Audio"));
AddTab(new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryTimeline),
tr("Timeline"));
AddTab(new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryPlayback),
tr("Playback"));
AddTab(
new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryTimeline),
tr("Timeline"));
AddTab(
new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryPlayback),
tr("Playback"));
AddTab(new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryProject),
tr("Project"));
AddTab(new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryNodes),
tr("Nodes"));
AddTab(new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryRendering),
tr("Rendering"));
AddTab(
new PreferencesBehaviorTab(PreferencesBehaviorTab::kCategoryRendering),
tr("Rendering"));
AddTab(new PreferencesDiskTab(), tr("Disk"));
AddTab(new PreferencesKeyboardTab(main_window), tr("Keyboard"));
+14 -14
View File
@@ -15,18 +15,18 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
dialog/preferences/tabs/preferencesgeneraltab.h
dialog/preferences/tabs/preferencesgeneraltab.cpp
dialog/preferences/tabs/preferencesbehaviortab.h
dialog/preferences/tabs/preferencesbehaviortab.cpp
dialog/preferences/tabs/preferencesdisktab.h
dialog/preferences/tabs/preferencesdisktab.cpp
dialog/preferences/tabs/preferencesappearancetab.h
dialog/preferences/tabs/preferencesappearancetab.cpp
dialog/preferences/tabs/preferencesaudiotab.h
dialog/preferences/tabs/preferencesaudiotab.cpp
dialog/preferences/tabs/preferenceskeyboardtab.h
dialog/preferences/tabs/preferenceskeyboardtab.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
dialog/preferences/tabs/preferencesgeneraltab.h
dialog/preferences/tabs/preferencesgeneraltab.cpp
dialog/preferences/tabs/preferencesbehaviortab.h
dialog/preferences/tabs/preferencesbehaviortab.cpp
dialog/preferences/tabs/preferencesdisktab.h
dialog/preferences/tabs/preferencesdisktab.cpp
dialog/preferences/tabs/preferencesappearancetab.h
dialog/preferences/tabs/preferencesappearancetab.cpp
dialog/preferences/tabs/preferencesaudiotab.h
dialog/preferences/tabs/preferencesaudiotab.cpp
dialog/preferences/tabs/preferenceskeyboardtab.h
dialog/preferences/tabs/preferenceskeyboardtab.cpp
PARENT_SCOPE
)
@@ -40,8 +40,7 @@ PreferencesBehaviorTab::PreferencesBehaviorTab(Category category)
AddItems({
{ tr("Auto-Seek to Imported Clips"),
QStringLiteral("EnableSeekToImport") },
{ tr("Edit Tool Also Seeks"),
QStringLiteral("EditToolAlsoSeeks") },
{ tr("Edit Tool Also Seeks"), QStringLiteral("EditToolAlsoSeeks") },
{ tr("Edit Tool Selects Links"),
QStringLiteral("EditToolSelectsLinks") },
{ tr("Enable Drag Files to Timeline"),
@@ -83,8 +82,7 @@ PreferencesBehaviorTab::PreferencesBehaviorTab(Category category)
});
break;
case kCategoryRendering:
{
case kCategoryRendering: {
QLabel *backend_label = new QLabel(tr("Graphics Backend"));
backend_label->setToolTip(
tr("Selects the graphics API Oak should request on next launch. "
@@ -94,17 +92,16 @@ PreferencesBehaviorTab::PreferencesBehaviorTab(Category category)
graphics_backend_combobox_ = new QComboBox();
graphics_backend_combobox_->addItem(tr("OpenGL"),
QStringLiteral("opengl"));
QStringLiteral("opengl"));
graphics_backend_combobox_->addItem(tr("Vulkan (experimental)"),
QStringLiteral("vulkan"));
QStringLiteral("vulkan"));
const QString current_backend =
OLIVE_CONFIG("GraphicsBackend").toString().toLower();
const int backend_index = graphics_backend_combobox_->findData(
current_backend.isEmpty() ? QStringLiteral("opengl")
: current_backend);
graphics_backend_combobox_->setCurrentIndex(backend_index >= 0
? backend_index
: 0);
current_backend.isEmpty() ? QStringLiteral("opengl") :
current_backend);
graphics_backend_combobox_->setCurrentIndex(
backend_index >= 0 ? backend_index : 0);
QHBoxLayout *backend_layout = new QHBoxLayout();
backend_layout->addWidget(backend_label);
@@ -49,7 +49,8 @@ public:
static QString BehaviorPrefTr(const char *text)
{
return QCoreApplication::translate("olive::PreferencesBehaviorTab", text);
return QCoreApplication::translate("olive::PreferencesBehaviorTab",
text);
}
private:
@@ -105,16 +105,14 @@ PreferencesDiskTab::PreferencesDiskTab()
proxy_width_slider_ = new IntegerSlider();
proxy_width_slider_->SetMinimum(160);
proxy_width_slider_->SetMaximum(4096);
proxy_width_slider_->SetValue(
OLIVE_CONFIG("ProxyWidth").value<int>());
proxy_width_slider_->SetValue(OLIVE_CONFIG("ProxyWidth").value<int>());
proxy_layout->addWidget(proxy_width_slider_, proxy_row, 1);
proxy_layout->addWidget(new QLabel(tr("Proxy Height:")), proxy_row, 2);
proxy_height_slider_ = new IntegerSlider();
proxy_height_slider_->SetMinimum(120);
proxy_height_slider_->SetMaximum(2160);
proxy_height_slider_->SetValue(
OLIVE_CONFIG("ProxyHeight").value<int>());
proxy_height_slider_->SetValue(OLIVE_CONFIG("ProxyHeight").value<int>());
proxy_layout->addWidget(proxy_height_slider_, proxy_row, 3);
proxy_row++;
@@ -123,28 +121,22 @@ PreferencesDiskTab::PreferencesDiskTab()
proxy_crf_slider_ = new IntegerSlider();
proxy_crf_slider_->SetMinimum(0);
proxy_crf_slider_->SetMaximum(51);
proxy_crf_slider_->SetValue(
OLIVE_CONFIG("ProxyCRF").value<int>());
proxy_crf_slider_->SetValue(OLIVE_CONFIG("ProxyCRF").value<int>());
proxy_layout->addWidget(proxy_crf_slider_, proxy_row, 1);
proxy_layout->addWidget(new QLabel(tr("Proxy Preset:")), proxy_row, 2);
proxy_preset_combo_ = new QComboBox();
const QStringList presets = {
QStringLiteral("ultrafast"),
QStringLiteral("superfast"),
QStringLiteral("veryfast"),
QStringLiteral("faster"),
QStringLiteral("fast"),
QStringLiteral("medium"),
QStringLiteral("slow"),
QStringLiteral("slower"),
QStringLiteral("ultrafast"), QStringLiteral("superfast"),
QStringLiteral("veryfast"), QStringLiteral("faster"),
QStringLiteral("fast"), QStringLiteral("medium"),
QStringLiteral("slow"), QStringLiteral("slower"),
QStringLiteral("veryslow"),
};
for (const QString &preset : presets) {
proxy_preset_combo_->addItem(preset);
}
proxy_preset_combo_->setCurrentText(
OLIVE_CONFIG("ProxyPreset").toString());
proxy_preset_combo_->setCurrentText(OLIVE_CONFIG("ProxyPreset").toString());
proxy_layout->addWidget(proxy_preset_combo_, proxy_row, 3);
outer_layout->addStretch();
@@ -185,8 +177,10 @@ void PreferencesDiskTab::Accept(MultiUndoCommand *command)
OLIVE_CONFIG("DiskCacheAhead") = QVariant::fromValue(
rational::fromDouble(cache_ahead_slider_->GetValue()));
OLIVE_CONFIG("ProxyWidth") = static_cast<int>(proxy_width_slider_->GetValue());
OLIVE_CONFIG("ProxyHeight") = static_cast<int>(proxy_height_slider_->GetValue());
OLIVE_CONFIG("ProxyWidth") =
static_cast<int>(proxy_width_slider_->GetValue());
OLIVE_CONFIG("ProxyHeight") =
static_cast<int>(proxy_height_slider_->GetValue());
OLIVE_CONFIG("ProxyCRF") = static_cast<int>(proxy_crf_slider_->GetValue());
OLIVE_CONFIG("ProxyPreset") = proxy_preset_combo_->currentText();
}
@@ -169,21 +169,25 @@ PreferencesGeneralTab::PreferencesGeneralTab()
}
{
QGroupBox *behavior_groupbox = new QGroupBox(PreferencesBehaviorTab::BehaviorPrefTr("Behavior"));
QGroupBox *behavior_groupbox =
new QGroupBox(PreferencesBehaviorTab::BehaviorPrefTr("Behavior"));
QVBoxLayout *behavior_layout = new QVBoxLayout(behavior_groupbox);
layout->addWidget(behavior_groupbox);
hover_focus_ = new QCheckBox(PreferencesBehaviorTab::BehaviorPrefTr("Enable hover focus"));
hover_focus_ = new QCheckBox(
PreferencesBehaviorTab::BehaviorPrefTr("Enable hover focus"));
hover_focus_->setToolTip(PreferencesBehaviorTab::BehaviorPrefTr(
"Panels will be considered focused when the mouse cursor is over them without having to click them."));
hover_focus_->setChecked(OLIVE_CONFIG("HoverFocus").toBool());
behavior_layout->addWidget(hover_focus_);
slider_ladder_ = new QCheckBox(PreferencesBehaviorTab::BehaviorPrefTr("Enable slider ladder"));
slider_ladder_ = new QCheckBox(
PreferencesBehaviorTab::BehaviorPrefTr("Enable slider ladder"));
slider_ladder_->setChecked(OLIVE_CONFIG("UseSliderLadders").toBool());
behavior_layout->addWidget(slider_ladder_);
scroll_zooms_ = new QCheckBox(PreferencesBehaviorTab::BehaviorPrefTr("Scrolling zooms by default"));
scroll_zooms_ = new QCheckBox(PreferencesBehaviorTab::BehaviorPrefTr(
"Scrolling zooms by default"));
scroll_zooms_->setToolTip(PreferencesBehaviorTab::BehaviorPrefTr(
"By default, scrolling will move the view around, and holding Ctrl/Cmd will make it zoom instead. "
"Enabling this will switch those, scrolling will zoom by default, and holding Ctrl/Cmd will move the view instead."));