88 SkipNextIcon ,
99 SkipPreviousIcon ,
1010} from ' @/icons' ;
11- import { useBrowseStore , useSearchStore , useStateStore , useThemeStore } from ' @/stores' ;
11+ import { useBrowseStore , useSearchStore , useThemeStore } from ' @/stores' ;
1212import { NBadge , NButton , NFlex , NIcon } from ' naive-ui' ;
1313import { computed , onMounted } from ' vue' ;
1414
@@ -22,17 +22,10 @@ withDefaults(
2222 }
2323);
2424
25- const state = useStateStore ();
2625const browse = useBrowseStore ();
2726const search = useSearchStore ();
2827const theme = useThemeStore ();
2928
30- const bgColor = computed (() =>
31- !! state .pf ?.state .browseBarUsesTextColor
32- ? theme .getTextColors ().fade4
33- : ' var(--primary-color-fade4)'
34- );
35-
3629const resultNo = computed (
3730 () =>
3831 search .settingsGeneral .pgn .pgs * (search .settingsGeneral .pgn .pg - 1 ) +
@@ -44,6 +37,8 @@ const viewingSearchResult = computed(
4437 () => search .browseCurrHit ?.id === browse .locationPathHead ?.id
4538);
4639
40+ const toolbarTxtColor = computed (() => (theme .dark ? ' #fff' : ' #333' ));
41+
4742async function skip(direction : ' previous' | ' next' ) {
4843 await search .browseSkipTo (direction );
4944 if (search .browseHitResourcesActive ) {
@@ -83,12 +78,13 @@ onMounted(() => {
8378 align =" center"
8479 :wrap =" false"
8580 class =" bsr-toolbar"
86- :style =" { backgroundColor: bgColor }"
81+ :style =" { backgroundColor: theme.dark ? '#444' : '#c5c5c5' }"
8782 >
8883 <n-flex :wrap =" false" >
8984 <!-- skip to previous search result -->
9085 <n-button
9186 quaternary
87+ :color =" toolbarTxtColor"
9288 :size =" buttonSize"
9389 :title =" $t('search.results.browsePrev')"
9490 :focusable =" false"
@@ -103,6 +99,7 @@ onMounted(() => {
10399 <!-- go to search results -->
104100 <n-button
105101 quaternary
102+ :color =" toolbarTxtColor"
106103 :size =" buttonSize"
107104 :title =" $t('search.results.heading')"
108105 :focusable =" false"
@@ -117,6 +114,7 @@ onMounted(() => {
117114 <!-- skip to next search result -->
118115 <n-button
119116 quaternary
117+ :color =" toolbarTxtColor"
120118 :size =" buttonSize"
121119 :title =" $t('search.results.browseNext')"
122120 :focusable =" false"
@@ -137,6 +135,7 @@ onMounted(() => {
137135 align =" center"
138136 :wrap =" false"
139137 class =" bsr-toolbar-middle text-small"
138+ :style =" { color: toolbarTxtColor }"
140139 >
141140 <n-flex
142141 v-if =" !search.loading"
@@ -167,6 +166,7 @@ onMounted(() => {
167166 <n-button
168167 :quaternary =" !search.browseHitResourcesActive"
169168 :tertiary =" search.browseHitResourcesActive"
169+ :color =" toolbarTxtColor"
170170 :size =" buttonSize"
171171 :title =" $t('search.results.browseHitResourcesActive')"
172172 :focusable =" false"
@@ -181,6 +181,7 @@ onMounted(() => {
181181 <!-- stop browsing search results -->
182182 <n-button
183183 quaternary
184+ :color =" toolbarTxtColor"
184185 :size =" buttonSize"
185186 :title =" $t('search.results.browseStop')"
186187 :focusable =" false"
@@ -202,7 +203,7 @@ onMounted(() => {
202203}
203204
204205.bsr-toolbar {
205- padding : var (--gap-sm );
206+ padding : var (--gap-sm ) var ( --gap-md ) ;
206207 border-bottom-left-radius : var (--border-radius );
207208 border-bottom-right-radius : var (--border-radius );
208209}
0 commit comments