2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 03:19:01 +00:00

fix: fix rtl in mac to prevernt traffic lights overlapping

This commit is contained in:
zaqoutabed 2023-01-21 14:50:47 +02:00
parent 2351110f84
commit 3e1d3cee54
2 changed files with 21 additions and 2 deletions

View File

@ -16,7 +16,9 @@
<h1 class="text-xl font-semibold select-none" v-if="title">
{{ title }}
</h1>
<div class="flex items-stretch window-no-drag gap-2 ms-auto">
<div
class="flex items-stretch window-no-drag gap-2 ms-auto"
:class="platform === 'Mac' && languageDirection === 'rtl' ? 'me-20' : ''">
<slot />
<div class="border-e" v-if="showBorder" />
<BackLink v-if="backLink" class="window-no-drag rtl-rotate-180" />
@ -28,6 +30,8 @@
import { Transition } from 'vue';
import BackLink from './BackLink.vue';
import SearchBar from './SearchBar.vue';
import { fyo } from 'src/initFyo';
import { RTL_LANGUAGES } from 'fyo/utils/consts';
export default {
inject: ['sidebar'],
@ -43,6 +47,13 @@ export default {
showBorder() {
return !!this.$slots.default && this.searchborder;
},
languageDirection(){
const language = fyo.config.get('language');
const languageDirection = RTL_LANGUAGES.includes(language)
? 'rtl'
: 'ltr';
return languageDirection;
}
},
};
</script>

View File

@ -9,7 +9,7 @@
<!-- Company name and DB Switcher -->
<div
class="px-4 flex flex-row items-center justify-between mb-4"
:class="platform === 'Mac' ? 'mt-10' : 'mt-2'"
:class="platform === 'Mac' && languageDirection === 'ltr' ? 'mt-10' : 'mt-2'"
>
<h6
class="
@ -164,6 +164,7 @@ import { getSidebarConfig } from 'src/utils/sidebarConfig';
import { docsPath, routeTo } from 'src/utils/ui';
import router from '../router';
import Icon from './Icon.vue';
import { RTL_LANGUAGES } from 'fyo/utils/consts';
export default {
components: [Button],
@ -179,6 +180,13 @@ export default {
appVersion() {
return fyo.store.appVersion;
},
languageDirection(){
const language = fyo.config.get('language');
const languageDirection = RTL_LANGUAGES.includes(language)
? 'rtl'
: 'ltr';
return languageDirection;
}
},
components: {
Icon,