Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: some ui problems in uni-mode #3029

Merged
merged 5 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.uni-slide-bar {
display: flex;
flex-direction: column;
border-right: 1px solid #eaecf0;
height: 100%;
user-select: none;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class UniuiLeftSidebarController extends Disposable {
this._leftSidebarService.open({
children: { label: OUTLINE_COMPONENT },
visible: true,
width: 176,
width: 185,
});
} else {
this._leftSidebarService.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import type { Nullable, UnitModel, UniverInstanceType } from '@univerjs/core';
import { createIdentifier, Disposable, ILocalStorageService, isInternalEditorID, IUniverInstanceService } from '@univerjs/core';
import type { Nullable, UnitModel } from '@univerjs/core';
import { createIdentifier, Disposable, ILocalStorageService, isInternalEditorID, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import type { IRender } from '@univerjs/engine-render';
import { IRenderManagerService } from '@univerjs/engine-render';
import type { Observable } from 'rxjs';
Expand Down Expand Up @@ -167,12 +167,12 @@ export class UnitGridService extends Disposable implements IUnitGridService {
type,
},
style: {
width: '940px',
width: type === UniverInstanceType.UNIVER_SLIDE ? '1000px' : '940px',
height: '854px',
display: 'flex',
borderRadius: '8px',
border: '1px solid #ccc',
backgroundColor: '#fff',
backgroundColor: type === UniverInstanceType.UNIVER_SHEET ? '#fff' : '#f4f6f8',
},
position: { x: (index % MAX_COUNT_IN_ROW) * 1050, y: Math.floor(index / MAX_COUNT_IN_ROW) * 950 + 40 },
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
height: 0;
min-height: 100%;
margin: auto;
overflow: hidden;

background-color: rgb(var(--bg-color-secondary));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export const InsertSlideFloatImageOperation: ICommand<IInsertImageOperationParam
if (!slideData) return false;

const activePage = slideData.getActivePage()!;
const maxIndex = activePage.pageElements ? Math.max(...Object.values(activePage.pageElements).map((element) => element.zIndex)) : 20;

const elements = Object.values(activePage.pageElements);
const maxIndex = (elements?.length) ? Math.max(...elements.map((element) => element.zIndex)) : 20;
const data = {
id: imageId,
zIndex: maxIndex + 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ export const InsertSlideShapeRectangleOperation: ICommand<IInsertShapeOperationP
if (!slideData) return false;

const activePage = slideData.getActivePage()!;
const maxIndex = activePage.pageElements ? Math.max(...Object.values(activePage.pageElements).map((element) => element.zIndex)) : 20;
const elements = Object.values(activePage.pageElements);
const maxIndex = (elements?.length) ? Math.max(...elements.map((element) => element.zIndex)) : 20;

const data = {
id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export const SlideAddTextOperation: ICommand<ISlideAddTextParam> = {

const activePage = slideData.getActivePage()!;

const maxIndex = activePage.pageElements ? Math.max(...Object.values(activePage.pageElements).map((element) => element.zIndex)) : 21;

const elements = Object.values(activePage.pageElements);
const maxIndex = (elements?.length) ? Math.max(...elements.map((element) => element.zIndex)) : 21;
const elementData: IPageElement = {
id: elementId,
zIndex: maxIndex + 1,
Expand Down
Loading