2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +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"> <h1 class="text-xl font-semibold select-none" v-if="title">
{{ title }} {{ title }}
</h1> </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 /> <slot />
<div class="border-e" v-if="showBorder" /> <div class="border-e" v-if="showBorder" />
<BackLink v-if="backLink" class="window-no-drag rtl-rotate-180" /> <BackLink v-if="backLink" class="window-no-drag rtl-rotate-180" />
@ -28,6 +30,8 @@
import { Transition } from 'vue'; import { Transition } from 'vue';
import BackLink from './BackLink.vue'; import BackLink from './BackLink.vue';
import SearchBar from './SearchBar.vue'; import SearchBar from './SearchBar.vue';
import { fyo } from 'src/initFyo';
import { RTL_LANGUAGES } from 'fyo/utils/consts';
export default { export default {
inject: ['sidebar'], inject: ['sidebar'],
@ -43,6 +47,13 @@ export default {
showBorder() { showBorder() {
return !!this.$slots.default && this.searchborder; return !!this.$slots.default && this.searchborder;
}, },
languageDirection(){
const language = fyo.config.get('language');
const languageDirection = RTL_LANGUAGES.includes(language)
? 'rtl'
: 'ltr';
return languageDirection;
}
}, },
}; };
</script> </script>

View File

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