`;
ht += `
`;
@@ -1052,6 +1076,8 @@ async function UIDesktop(options){
$(el_desktop).on('click', function(e){
// blur all windows
$('.window-active').removeClass('window-active');
+ // hide all global menubars
+ $('.window-menubar-global').hide();
})
function display_ct() {
diff --git a/src/UI/UIWindow.js b/src/UI/UIWindow.js
index 16ad79f3..eda9925b 100644
--- a/src/UI/UIWindow.js
+++ b/src/UI/UIWindow.js
@@ -275,9 +275,10 @@ async function UIWindow(options) {
}
// Menubar
- {
- h += ``;
+ if(window.menubar_style === 'window'){
+ h += ``;
+ }else if(window.menubar_style === 'desktop'){
+ $('.toolbar-puter-logo').after(``);
}
// Navbar
@@ -3008,7 +3009,6 @@ $.fn.close = async function(options) {
}
}
-
if ( this.on_before_exit ) {
if ( ! await this.on_before_exit() ) return false;
}
@@ -3083,6 +3083,10 @@ $.fn.close = async function(options) {
// remove backdrop
$(this).closest('.window-backdrop').remove();
+
+ // remove global menubars
+ $(`.window-menubar-global[data-window-id="${win_id}"]`).remove();
+
// remove DOM element
if(options?.shrink_to_target){
// get target location
@@ -3316,6 +3320,7 @@ window.toggle_empty_folder_message = function(el_item_container){
$.fn.focusWindow = function(event) {
if(this.hasClass('window')){
const $app_iframe = $(this).find('.window-app-iframe');
+ const win_id = $(this).attr('data-id');
$('.window').not(this).removeClass('window-active');
$(this).addClass('window-active');
// disable pointer events on all windows' iframes, except for this window's iframe
@@ -3333,6 +3338,11 @@ $.fn.focusWindow = function(event) {
$(`.window[data-parent_uuid="${$(this).attr('data-element_uuid')}"]`).css('z-index', ++window.last_window_zindex);
}
+ // hide other global menubars
+ $('.window-menubar-global').not(`.window-menubar-global[data-window-id="${win_id}"]`).hide();
+ // show this window's global menubar
+ $(`.window-menubar-global[data-window-id="${win_id}"]`).show();
+
// if a menubar or any of its items are clicked, don't focus the iframe. This is important to preserve the focus on the menubar
// and to enable keyboard navigation through the menubar items
if($(event?.target).hasClass('window-menubar') || $(event?.target).closest('.window-menubar').length > 0){
diff --git a/src/css/style.css b/src/css/style.css
index e23edecf..fd1e3eee 100644
--- a/src/css/style.css
+++ b/src/css/style.css
@@ -802,6 +802,9 @@ span.header-sort-icon img {
text-shadow: none;
}
+.window-menubar:not(.window-menubar-global):empty {
+ display: none !important;
+}
.window-menubar {
display: flex;
box-sizing: border-box;
@@ -812,6 +815,22 @@ span.header-sort-icon img {
padding: 2px 5px;
}
+.window-menubar-global{
+ background-color: transparent;
+ color: white;
+ border-bottom: none;
+ flex-grow: 1;
+ scale: 1;
+ --scale: 1;
+ margin-left: 15px;
+ padding: 0;
+}
+.window-menubar-global .window-menubar-item span{
+ padding: 3px 10px;
+ font-size: 13px;
+ border-radius: 3px;
+}
+
.window-menubar-item {
padding: calc(1.4 * var(--scale)) 0;
font-size: calc(5 * var(--scale));
@@ -825,11 +844,13 @@ span.header-sort-icon img {
}
.window-menubar-item.active>span {
- /* background-color: var(--select-color);
- color: white; */
background-color: #e2e2e2;
}
+.window-menubar-global .window-menubar-item.active>span {
+ background-color: #e4e4e43a;
+}
+
.explorer-empty-message {
text-align: center;
margin-top: 20px;
@@ -1362,6 +1383,10 @@ span.header-sort-icon img {
overflow: hidden;
}
+.menubar-style-desktop .window-app-iframe {
+ height: calc(100% + 35px);
+}
+
.window-active .window-app-iframe {
pointer-events: all;
}
diff --git a/src/globals.js b/src/globals.js
index 5b1b1543..4f0c2d98 100644
--- a/src/globals.js
+++ b/src/globals.js
@@ -232,4 +232,11 @@ window.desktop_item_positions = {};
window.reset_item_positions = true; // The variable decides if the item positions should be reset when the user enabled auto arrange
// default language
-window.locale = 'en';
\ No newline at end of file
+window.locale = 'en';
+
+/* Menubar style
+ * 'window' - menubar is part of the window
+ * 'desktop' - menubar is part of the desktop
+ * 'system' - menubar is determined by the system (e.g. Windows, macOS)
+ */
+// window.menubar_style = 'desktop';
\ No newline at end of file
diff --git a/src/helpers.js b/src/helpers.js
index e8f6fdb2..394bcc65 100644
--- a/src/helpers.js
+++ b/src/helpers.js
@@ -2397,3 +2397,19 @@ window.countSubstr = (str, substring)=>{
return count;
}
+
+window.detectHostOS = function(){
+ var userAgent = window.navigator.userAgent;
+ var platform = window.navigator.platform;
+ var macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'];
+ var windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'];
+
+ if (macosPlatforms.indexOf(platform) !== -1) {
+ return 'macos';
+ } else if (windowsPlatforms.indexOf(platform) !== -1) {
+ return 'windows';
+ } else {
+ return 'other';
+ }
+}
+
diff --git a/src/i18n/translations/en.js b/src/i18n/translations/en.js
index 350dd863..6f8db6c7 100644
--- a/src/i18n/translations/en.js
+++ b/src/i18n/translations/en.js
@@ -147,6 +147,9 @@ const en = {
log_out: 'Log Out',
looks_good: "Looks good!",
manage_sessions: "Manage Sessions",
+ menubar_style_desktop: "Desktop",
+ menubar_style_system: "System",
+ menubar_style_window: "Window",
move: 'Move',
moving_file: "Moving %%",
my_websites: "My Websites",