mirror of
https://gitee.com/openharmony/applications_launcher
synced 2025-02-11 02:36:57 +00:00
bugfix
Signed-off-by: zhangchao <zhangchao338@huawei.com>
This commit is contained in:
parent
daf4c1ab7c
commit
b319b38cdf
@ -136,6 +136,7 @@ export class PageDesktopModel {
|
||||
abilityName: item.abilityName,
|
||||
moduleName: item.moduleName,
|
||||
keyName: item.keyName,
|
||||
badgeNumber:item.badgeNumber,
|
||||
area: item.area,
|
||||
page: i,
|
||||
column: x,
|
||||
@ -153,6 +154,7 @@ export class PageDesktopModel {
|
||||
abilityName: item.abilityName,
|
||||
moduleName: item.moduleName,
|
||||
keyName: item.keyName,
|
||||
badgeNumber:item.badgeNumber,
|
||||
area: item.area,
|
||||
page: pageCount,
|
||||
column: 0,
|
||||
|
@ -49,7 +49,9 @@ export struct AppBubble {
|
||||
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
AppMenu({
|
||||
menuInfoList: this.menuInfo,
|
||||
isContextMenu: true
|
||||
closeMenu: () => {
|
||||
ContextMenu.close();
|
||||
}
|
||||
})
|
||||
}
|
||||
.width(StyleConstants.CONTEXT_MENU_WIDTH)
|
||||
|
@ -23,13 +23,13 @@ const TAG = 'AppMenu';
|
||||
|
||||
@Component
|
||||
export struct AppMenu {
|
||||
isContextMenu: boolean = false;
|
||||
menuInfoList: Array<MenuInfo> = new Array<MenuInfo>();
|
||||
getMenuInfoList: Function;
|
||||
menuMode: number = CommonConstants.MENU_UI_MODE_LIGHT;
|
||||
fixedMenuList: Array<MenuInfo> = null;
|
||||
dynamicMenuList: Array<MenuInfo> = null;
|
||||
isBothTypeMenuExist: boolean = true;
|
||||
closeMenu: Function;
|
||||
|
||||
aboutToAppear(): void {
|
||||
Log.showInfo(TAG, 'aboutToAppear start');
|
||||
@ -63,7 +63,7 @@ export struct AppMenu {
|
||||
HorizontalMenuItem({
|
||||
menuInfo: item,
|
||||
menuMode: this.menuMode,
|
||||
isContextMenu: this.isContextMenu
|
||||
closeMenu: this.closeMenu
|
||||
})
|
||||
}
|
||||
}, item => JSON.stringify(item))
|
||||
@ -83,7 +83,7 @@ export struct AppMenu {
|
||||
HorizontalMenuItem({
|
||||
menuInfo: item,
|
||||
menuMode: this.menuMode,
|
||||
isContextMenu: this.isContextMenu
|
||||
closeMenu: this.closeMenu
|
||||
})
|
||||
}
|
||||
}, item => JSON.stringify(item))
|
||||
@ -104,10 +104,10 @@ export struct AppMenu {
|
||||
struct HorizontalMenuItem {
|
||||
@State shortcutIcon: string = StyleConstants.DEFAULT_ICON;
|
||||
@State shortcutName: string = "";
|
||||
isContextMenu: boolean;
|
||||
private mResourceManager;
|
||||
menuInfo: MenuInfo;
|
||||
menuMode: number = CommonConstants.MENU_UI_MODE_LIGHT;
|
||||
closeMenu: Function = null;
|
||||
|
||||
aboutToAppear(): void {
|
||||
this.mResourceManager = ResourceManager.getInstance();
|
||||
@ -178,8 +178,8 @@ struct HorizontalMenuItem {
|
||||
.width(235)
|
||||
.onClick(() => {
|
||||
this.menuInfo.onMenuClick();
|
||||
if (this.isContextMenu) {
|
||||
ContextMenu.close();
|
||||
if (this.closeMenu) {
|
||||
this.closeMenu();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -111,7 +111,10 @@ export struct FolderComponent {
|
||||
@Builder MenuBuilder() {
|
||||
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
AppMenu({
|
||||
menuInfoList: this.buildMenu(this.mFolderItem)
|
||||
menuInfoList: this.buildMenu(this.mFolderItem),
|
||||
closeMenu: () => {
|
||||
ContextMenu.close();
|
||||
}
|
||||
})
|
||||
}
|
||||
.width(StyleConstants.CONTEXT_MENU_WIDTH)
|
||||
|
@ -51,7 +51,10 @@ export struct FormItemComponent {
|
||||
@Builder MenuBuilder() {
|
||||
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
AppMenu({
|
||||
menuInfoList: this.menuInfo
|
||||
menuInfoList: this.menuInfo,
|
||||
closeMenu: () => {
|
||||
ContextMenu.close();
|
||||
}
|
||||
})
|
||||
}
|
||||
.width(StyleConstants.CONTEXT_MENU_WIDTH)
|
||||
|
@ -243,9 +243,11 @@ export struct FolderOpenComponent {
|
||||
.index(this.PageIndex)
|
||||
.loop(false)
|
||||
.onChange((index) => {
|
||||
Log.showDebug(TAG, `mBigFolderViewModel.changeIndex(index):${index}`);
|
||||
this.mFolderInfo = mBigFolderViewModel.addAddIcon(this.mFolderInfo);
|
||||
mBigFolderViewModel.changeIndex(index);
|
||||
Log.showDebug(TAG, `onChange :${index}`);
|
||||
if (this.PageIndex != index) {
|
||||
this.mFolderInfo = mBigFolderViewModel.addAddIcon(this.mFolderInfo);
|
||||
this.PageIndex = index;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -276,7 +278,8 @@ export struct FolderOpenComponent {
|
||||
mBigFolderViewModel.modifyFolderName(this.mFolderInfo)
|
||||
}
|
||||
} else {
|
||||
if (!isOpenFolderDialog) {
|
||||
const contextMenuState: boolean = AppStorage.Get('contextMenuState');
|
||||
if (!isOpenFolderDialog && !contextMenuState) {
|
||||
mBigFolderViewModel.closeFolder();
|
||||
}
|
||||
}
|
||||
|
@ -826,7 +826,7 @@ export class BigFolderViewModel extends BaseViewModel {
|
||||
* @return {boolean} isPad.
|
||||
*/
|
||||
getIsPad(): boolean {
|
||||
return CommonConstants.PAD_DEVICE_TYPE == AppStorage.Get('device');
|
||||
return CommonConstants.PAD_DEVICE_TYPE == AppStorage.Get('deviceType');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -80,6 +80,7 @@ export default struct SwiperPage {
|
||||
this.movingIconSwapPageDelay();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Increase delay when dragging app to other page.
|
||||
*/
|
||||
|
@ -133,7 +133,10 @@ export struct PageDesktopLayout {
|
||||
if (this.logId()) {
|
||||
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
AppMenu({
|
||||
getMenuInfoList: this.getMenu
|
||||
getMenuInfoList: this.getMenu,
|
||||
closeMenu: () => {
|
||||
ContextMenu.close();
|
||||
}
|
||||
})
|
||||
}
|
||||
.width(StyleConstants.CONTEXT_MENU_WIDTH)
|
||||
|
@ -215,7 +215,9 @@ struct AppItem {
|
||||
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
AppMenu({
|
||||
menuInfoList: this.menuInfo,
|
||||
isContextMenu: false
|
||||
closeMenu: () => {
|
||||
this.isShow = false;
|
||||
}
|
||||
})
|
||||
}
|
||||
.width(StyleConstants.CONTEXT_MENU_WIDTH)
|
||||
|
@ -142,7 +142,9 @@ struct AppItem {
|
||||
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
AppMenu({
|
||||
menuInfoList: this.menuInfo,
|
||||
isContextMenu: false
|
||||
closeMenu: () => {
|
||||
this.isShow = false;
|
||||
}
|
||||
})
|
||||
}
|
||||
.width(StyleConstants.CONTEXT_MENU_WIDTH)
|
||||
|
@ -36,7 +36,7 @@ struct AppCenterView {
|
||||
|
||||
aboutToAppear(): void {
|
||||
Log.showInfo(TAG, 'aboutToAppear');
|
||||
AppStorage.SetOrCreate('device', this.device);
|
||||
AppStorage.SetOrCreate('deviceType', this.device);
|
||||
this.mLayoutViewModel = LayoutViewModel.getInstance();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user