Skip to content

Commit

Permalink
Windows: Better touch experience
Browse files Browse the repository at this point in the history
  • Loading branch information
xfangfang committed Jul 3, 2024
1 parent d802f22 commit 799679b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions wiliwili/include/utils/config_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ enum class SettingItem {
APP_LANG, // 应用语言
APP_RESOURCES, // 自定义界面布局
APP_UI_SCALE, // 界面缩放
SCROLL_SPEED, // 列表滑动速度
HISTORY_REPORT,
PLAYER_STRATEGY,
PLAYER_BOTTOM_BAR,
Expand Down
11 changes: 11 additions & 0 deletions wiliwili/source/utils/config_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <borealis/core/application.hpp>
#include <borealis/core/cache_helper.hpp>
#include <borealis/core/touch/pan_gesture.hpp>
#include <cpr/filesystem.h>

#include "bilibili.h"
Expand Down Expand Up @@ -223,6 +224,7 @@ std::unordered_map<SettingItem, ProgramOption> ProgramConfig::SETTING_MAP = {
{SettingItem::ON_TOP_WINDOW_WIDTH, {"on_top_window_width", {"480"}, {480}, 0}},
{SettingItem::ON_TOP_WINDOW_HEIGHT, {"on_top_window_height", {"270"}, {270}, 0}},
{SettingItem::ON_TOP_MODE, {"on_top_mode", {"off", "always", "auto"}, {0, 1, 2}, 0}},
{SettingItem::SCROLL_SPEED, {"scroll_speed", {}, {}, 0}},
};

ProgramConfig::ProgramConfig() = default;
Expand Down Expand Up @@ -558,6 +560,15 @@ void ProgramConfig::load() {
// 是否使用低质量解码
MPVCore::LOW_QUALITY = getBoolOption(SettingItem::PLAYER_LOW_QUALITY);

// 初始化滑动速度
#ifdef _WIN32
int scrollSpeed = getSettingItem(SettingItem::SCROLL_SPEED, 150);
#else
int scrollSpeed = getSettingItem(SettingItem::SCROLL_SPEED, 100);
#endif
brls::PanGestureRecognizer::panFactor = scrollSpeed * 0.01f;


// 初始化i18n
std::set<std::string> i18nData{
brls::LOCALE_AUTO, brls::LOCALE_EN_US, brls::LOCALE_JA, brls::LOCALE_RYU,
Expand Down

0 comments on commit 799679b

Please sign in to comment.