From: 罗正yun <1732036298@qq.com> Date: Thu, 4 Jan 2024 07:49:24 +0000 (+0800) Subject: 修改播放器调节声音slider,将其前景样式改为圆帽式,并将增加,减少音量图标设置为不可见 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=fa0318a610b323c143ec0b8d0ee1d872b16e6eb4;p=mirrors%2FFD230.git 修改播放器调节声音slider,将其前景样式改为圆帽式,并将增加,减少音量图标设置为不可见 --- diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/VolumeSettingView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/VolumeSettingView.cpp index c4d3bad80..afb1e1bd4 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/VolumeSettingView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/VolumeSettingView.cpp @@ -16,10 +16,10 @@ static constexpr uint16_t BUTTON_Y = 0; static constexpr uint16_t BUTTON_Y2 = 363; static constexpr uint16_t BUTTON_WIDTH = 90; static constexpr uint16_t BUTTON_HEIGHT = 90; -static constexpr uint16_t SLIDER_X = 207; -static constexpr uint16_t SLIDER_Y = 90; -static constexpr uint16_t SLIDER_WIDTH = 40; -static constexpr uint16_t SLIDER_HEIGHT = 274; +static constexpr uint16_t SLIDER_X = 167; +static constexpr uint16_t SLIDER_Y = 77; +static constexpr uint16_t SLIDER_WIDTH = 130; +static constexpr uint16_t SLIDER_HEIGHT = 310; constexpr uint16_t VOLUME_OK = 0; constexpr int16_t VOLUME_ERROR = (-1); @@ -76,6 +76,12 @@ bool VolumeSettingView::SetUpVolume(void) progress->SetDirection(UISlider::Direction::DIR_BOTTOM_TO_TOP); progress->SetViewId(VOLUME_PROGRESS); progress->SetRange(VOLUME_MAX, VOLUME_MIN); + + progress->SetStyle(STYLE_BORDER_RADIUS, 100); + progress->SetBackgroundStyle(STYLE_LINE_CAP, CapType::CAP_ROUND); + progress->SetForegroundStyle(STYLE_LINE_CAP,CapType::CAP_ROUND); + progress->SetSliderColor(Color::GetColorFromRGBA(0x19, 0x19, 0x19, 0xff), Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0xff)); + progress->SetForegroundStyle(STYLE_BACKGROUND_OPA, 0xff); if (listener == nullptr) { listener = new VolumeSliderEventListener(); @@ -130,6 +136,7 @@ int VolumeSettingView::ShowVolume(void) image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_INCREASE_BUTTON, PLAYER_IAMGES); increaseButton->SetImageSrc(image, image); increaseButton->SetOnClickListener(clickListener); + increaseButton->SetVisible(false); Add(increaseButton); if (decreaseButton == nullptr) { @@ -144,6 +151,7 @@ int VolumeSettingView::ShowVolume(void) image = ImageCacheManager::GetInstance().LoadOneInMultiRes(PLAYER_DECREASE_BUTTON, PLAYER_IAMGES); decreaseButton->SetImageSrc(image, image); decreaseButton->SetOnClickListener(clickListener); + decreaseButton->SetVisible(false); Add(decreaseButton); return VOLUME_OK;