修复常驻区没有应用时,其宽度变宽的问题

Signed-off-by: zhangchao <zhangchao338@huawei.com>
This commit is contained in:
zhangchao 2022-08-06 11:58:09 +08:00
parent 7fc4b524f7
commit f826e3c31e
2 changed files with 11 additions and 6 deletions

View File

@ -85,10 +85,16 @@ export class SettingsModel {
* force reload all config from disk.
*/
forceReloadConfig(): void {
this.mPageDesktopModeConfig.forceReloadConfig();
this.mPageDesktopLayoutConfig.forceReloadConfig();
this.mPageDesktopAppModeConfig.forceReloadConfig();
if (this.mRecentsModeConfig != null) {
if (this.mPageDesktopModeConfig) {
this.mPageDesktopModeConfig.forceReloadConfig();
}
if (this.mPageDesktopLayoutConfig) {
this.mPageDesktopLayoutConfig.forceReloadConfig();
}
if (this.mPageDesktopAppModeConfig) {
this.mPageDesktopAppModeConfig.forceReloadConfig();
}
if (this.mRecentsModeConfig) {
this.mRecentsModeConfig.forceReloadConfig();
}
this.notifyObservers(1);

View File

@ -16,7 +16,6 @@
import { AppMenu } from '@ohos/common';
import { AppIcon } from '@ohos/common';
import { DockItemInfo } from '@ohos/common';
import { ScrollerComponent } from '@ohos/common';
import { CommonConstants } from '@ohos/common';
import { StyleConstants } from '@ohos/common';
import { ResourceManager } from '@ohos/common';
@ -79,7 +78,7 @@ export default struct ResidentLayout {
})
}, (item) => JSON.stringify(item))
}
.padding(this.dockPadding)
.padding(this.appList.length == 0 ? this.mSmartDockStyleConfig.mDockPadding : this.dockPadding)
.width(this.getListWidth())
.height(this.mSmartDockStyleConfig.mDockHeight)
.backgroundColor(this.mSmartDockStyleConfig.mBackgroundColor)