mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 04:51:31 +08:00 
			
		
		
		
	don't use special layout for "extra window"
This commit is contained in:
		
							parent
							
								
									f9b0418333
								
							
						
					
					
						commit
						71c3fd5cbb
					
				| @ -5,9 +5,8 @@ import bundleService from "./services/bundle.js"; | |||||||
| import noteAutocompleteService from './services/note_autocomplete.js'; | import noteAutocompleteService from './services/note_autocomplete.js'; | ||||||
| import macInit from './services/mac_init.js'; | import macInit from './services/mac_init.js'; | ||||||
| import contextMenu from "./services/context_menu.js"; | import contextMenu from "./services/context_menu.js"; | ||||||
| import DesktopMainWindowLayout from "./layouts/desktop_main_window_layout.js"; | import DesktopLayout from "./layouts/desktop_layout.js"; | ||||||
| import glob from "./services/glob.js"; | import glob from "./services/glob.js"; | ||||||
| import DesktopExtraWindowLayout from "./layouts/desktop_extra_window_layout.js"; |  | ||||||
| import zoomService from './services/zoom.js'; | import zoomService from './services/zoom.js'; | ||||||
| 
 | 
 | ||||||
| glob.setupGlobs(); | glob.setupGlobs(); | ||||||
| @ -25,11 +24,7 @@ $('[data-toggle="tooltip"]').tooltip({ | |||||||
| macInit.init(); | macInit.init(); | ||||||
| 
 | 
 | ||||||
| bundleService.getWidgetBundlesByParent().then(widgetBundles => { | bundleService.getWidgetBundlesByParent().then(widgetBundles => { | ||||||
|     const layout = window.glob.isMainWindow |     appContext.setLayout(new DesktopLayout(widgetBundles)); | ||||||
|         ? new DesktopMainWindowLayout(widgetBundles) |  | ||||||
|         : new DesktopExtraWindowLayout(widgetBundles); |  | ||||||
| 
 |  | ||||||
|     appContext.setLayout(layout); |  | ||||||
|     appContext.start(); |     appContext.start(); | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,82 +0,0 @@ | |||||||
| import FlexContainer from "../widgets/flex_container.js"; |  | ||||||
| import GlobalMenuWidget from "../widgets/global_menu.js"; |  | ||||||
| import TabRowWidget from "../widgets/tab_row.js"; |  | ||||||
| import TitleBarButtonsWidget from "../widgets/title_bar_buttons.js"; |  | ||||||
| import NoteTreeWidget from "../widgets/note_tree.js"; |  | ||||||
| import TabCachingWidget from "../widgets/tab_caching_widget.js"; |  | ||||||
| import NoteTitleWidget from "../widgets/note_title.js"; |  | ||||||
| import NoteTypeWidget from "../widgets/note_type.js"; |  | ||||||
| import NoteActionsWidget from "../widgets/note_actions.js"; |  | ||||||
| import NoteDetailWidget from "../widgets/note_detail.js"; |  | ||||||
| import OwnedAttributeListWidget from "../widgets/type_property_widgets/owned_attribute_list.js"; |  | ||||||
| import CollapsibleSectionContainer from "../widgets/collapsible_section_container.js"; |  | ||||||
| import SearchDefinitionWidget from "../widgets/type_property_widgets/search_definition.js"; |  | ||||||
| import PromotedAttributesWidget from "../widgets/type_property_widgets/promoted_attributes.js"; |  | ||||||
| import InheritedAttributesWidget from "../widgets/type_property_widgets/inherited_attribute_list.js"; |  | ||||||
| import Container from "../widgets/container.js"; |  | ||||||
| import SqlTableSchemasWidget from "../widgets/sql_table_schemas.js"; |  | ||||||
| import NoteListWidget from "../widgets/note_list.js"; |  | ||||||
| import SqlResultWidget from "../widgets/sql_result.js"; |  | ||||||
| import FilePropertiesWidget from "../widgets/type_property_widgets/file_properties.js"; |  | ||||||
| import ImagePropertiesWidget from "../widgets/type_property_widgets/image_properties.js"; |  | ||||||
| import NotePropertiesWidget from "../widgets/type_property_widgets/note_properties.js"; |  | ||||||
| import NoteIconWidget from "../widgets/note_icon.js"; |  | ||||||
| import NotePathsWidget from "../widgets/note_paths.js"; |  | ||||||
| import SearchResultWidget from "../widgets/search_result.js"; |  | ||||||
| import ScrollingContainer from "../widgets/scrolling_container.js"; |  | ||||||
| 
 |  | ||||||
| export default class DesktopExtraWindowLayout { |  | ||||||
|     constructor(customWidgets) { |  | ||||||
|         this.customWidgets = customWidgets; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     getRootWidget(appContext) { |  | ||||||
|         appContext.mainTreeWidget = new NoteTreeWidget(); |  | ||||||
| 
 |  | ||||||
|         return new FlexContainer('column') |  | ||||||
|             .setParent(appContext) |  | ||||||
|             .id('root-widget') |  | ||||||
|             .css('height', '100vh') |  | ||||||
|             .child(new FlexContainer('row').overflowing() |  | ||||||
|                 .child(new GlobalMenuWidget()) |  | ||||||
|                 .child(new TabRowWidget()) |  | ||||||
|                 .child(new TitleBarButtonsWidget())) |  | ||||||
|             .child(new FlexContainer('row') |  | ||||||
|                 .collapsible() |  | ||||||
|                 .filling() |  | ||||||
|                 .child(new FlexContainer('column').id('center-pane').filling() |  | ||||||
|                     .child(new FlexContainer('row').class('title-row') |  | ||||||
|                         .css('align-items: center;') |  | ||||||
|                         .cssBlock('.title-row > * { margin: 5px; }') |  | ||||||
|                         .overflowing() |  | ||||||
|                         .child(new NoteIconWidget()) |  | ||||||
|                         .child(new NoteTitleWidget()) |  | ||||||
|                         .child(new NotePathsWidget().hideInZenMode()) |  | ||||||
|                         .child(new NoteTypeWidget().hideInZenMode()) |  | ||||||
|                         .child(new NoteActionsWidget().hideInZenMode()) |  | ||||||
|                     ) |  | ||||||
|                     .child( |  | ||||||
|                         new TabCachingWidget(() => new CollapsibleSectionContainer() |  | ||||||
|                             .child(new SearchDefinitionWidget()) |  | ||||||
|                             .child(new NotePropertiesWidget()) |  | ||||||
|                             .child(new FilePropertiesWidget()) |  | ||||||
|                             .child(new ImagePropertiesWidget()) |  | ||||||
|                             .child(new PromotedAttributesWidget()) |  | ||||||
|                             .child(new OwnedAttributeListWidget()) |  | ||||||
|                             .child(new InheritedAttributesWidget()) |  | ||||||
|                         ) |  | ||||||
|                     ) |  | ||||||
|                     .child( |  | ||||||
|                         new TabCachingWidget(() => new ScrollingContainer() |  | ||||||
|                             .child(new SqlTableSchemasWidget()) |  | ||||||
|                             .child(new NoteDetailWidget()) |  | ||||||
|                             .child(new NoteListWidget()) |  | ||||||
|                             .child(new SearchResultWidget()) |  | ||||||
|                             .child(new SqlResultWidget()) |  | ||||||
|                         ) |  | ||||||
|                     ) |  | ||||||
|                     .child(...this.customWidgets.get('center-pane')) |  | ||||||
|                 ) |  | ||||||
|             ); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @ -128,7 +128,7 @@ const RIGHT_PANE_CSS = ` | |||||||
| } | } | ||||||
| </style>`; | </style>`; | ||||||
| 
 | 
 | ||||||
| export default class DesktopMainWindowLayout { | export default class DesktopLayout { | ||||||
|     constructor(customWidgets) { |     constructor(customWidgets) { | ||||||
|         this.customWidgets = customWidgets; |         this.customWidgets = customWidgets; | ||||||
|     } |     } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam