mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-19 17:08:11 -04:00
@@ -97,6 +97,7 @@ namespace {
|
||||
constexpr uint32_t SYSTEM_COLOR_WHITE = 0xFFFFFFE5;
|
||||
constexpr uint32_t SYSTEM_COLOR_BLACK = 0x00000066;
|
||||
constexpr float DEFAULT_SPLIT_RATIO = 0.5;
|
||||
constexpr uint32_t DIVIDER_WIDTH = 8;
|
||||
}
|
||||
|
||||
struct SystemBarProperty {
|
||||
|
||||
@@ -163,16 +163,15 @@ void WindowTestUtils::InitSplitRects()
|
||||
if (displayRect_.width_ < displayRect_.height_) {
|
||||
isVerticalDisplay_ = true;
|
||||
}
|
||||
const uint32_t dividerWidth = 50;
|
||||
if (isVerticalDisplay_) {
|
||||
splitRects_.dividerRect = { 0,
|
||||
static_cast<uint32_t>((displayRect_.height_ - dividerWidth) * DEFAULT_SPLIT_RATIO),
|
||||
static_cast<uint32_t>((displayRect_.height_ - DIVIDER_WIDTH) * DEFAULT_SPLIT_RATIO),
|
||||
displayRect_.width_,
|
||||
dividerWidth, };
|
||||
DIVIDER_WIDTH, };
|
||||
} else {
|
||||
splitRects_.dividerRect = { static_cast<uint32_t>((displayRect_.width_ - dividerWidth) * DEFAULT_SPLIT_RATIO),
|
||||
splitRects_.dividerRect = { static_cast<uint32_t>((displayRect_.width_ - DIVIDER_WIDTH) * DEFAULT_SPLIT_RATIO),
|
||||
0,
|
||||
dividerWidth,
|
||||
DIVIDER_WIDTH,
|
||||
displayRect_.height_ };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,6 +147,16 @@ void InputWindowMonitor::TraverseWindowNodes(const std::vector<sptr<WindowNode>>
|
||||
.displayId = windowNode->GetDisplayId(),
|
||||
.agentWindowId = static_cast<int32_t>(windowNode->GetWindowId()),
|
||||
};
|
||||
if (windowNode->GetWindowType() == WindowType::WINDOW_TYPE_DOCK_SLICE) {
|
||||
const int32_t divTouchRegion = 20;
|
||||
if (windowInfo.width < windowInfo.height) {
|
||||
windowInfo.topLeftX -= divTouchRegion;
|
||||
windowInfo.width += (divTouchRegion + divTouchRegion);
|
||||
} else {
|
||||
windowInfo.topLeftY -= divTouchRegion;
|
||||
windowInfo.height += (divTouchRegion + divTouchRegion);
|
||||
}
|
||||
}
|
||||
iter->windowsInfo_.emplace_back(windowInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -500,13 +500,12 @@ void WindowNodeContainer::DisplayRects::InitRect(Rect& oriDisplayRect)
|
||||
isVertical_ = true;
|
||||
}
|
||||
displayRect_ = oriDisplayRect;
|
||||
const uint32_t dividerWidth = 50;
|
||||
if (!isVertical_) {
|
||||
dividerRect_ = { static_cast<uint32_t>((displayRect_.width_ - dividerWidth) * DEFAULT_SPLIT_RATIO), 0,
|
||||
dividerWidth, displayRect_.height_ };
|
||||
dividerRect_ = { static_cast<uint32_t>((displayRect_.width_ - DIVIDER_WIDTH) * DEFAULT_SPLIT_RATIO), 0,
|
||||
DIVIDER_WIDTH, displayRect_.height_ };
|
||||
} else {
|
||||
dividerRect_ = { 0, static_cast<uint32_t>((displayRect_.height_ - dividerWidth) * DEFAULT_SPLIT_RATIO),
|
||||
displayRect_.width_, dividerWidth };
|
||||
dividerRect_ = { 0, static_cast<uint32_t>((displayRect_.height_ - DIVIDER_WIDTH) * DEFAULT_SPLIT_RATIO),
|
||||
displayRect_.width_, DIVIDER_WIDTH };
|
||||
}
|
||||
WLOGFI("init dividerRect :[%{public}d, %{public}d, %{public}d, %{public}d]",
|
||||
dividerRect_.posX_, dividerRect_.posY_, dividerRect_.width_, dividerRect_.height_);
|
||||
|
||||
Reference in New Issue
Block a user