Skip to content

Commit

Permalink
fix(css): cover aspect-ratio and GUI search bar offset and Yes button…
Browse files Browse the repository at this point in the history
… dark theme (PR #2685 Fixes #2678 Fixes #2683)
  • Loading branch information
arthur-lemeur authored Dec 18, 2024
1 parent 3acc25a commit 59e5a71
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 15 deletions.
2 changes: 2 additions & 0 deletions src/renderer/assets/styles/components/publications.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
word-break: break-all;
display: -webkit-inline-box;
-webkit-line-clamp: 3;
line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-align: center;
Expand Down Expand Up @@ -532,6 +533,7 @@
word-break: break-all;
display: -webkit-inline-box;
-webkit-line-clamp: 3;
line-clamp: 3;

/* autoprefixer: ignore next */
-webkit-box-orient: vertical;
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/assets/styles/components/readerHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
.tts_toolbar {
justify-content: center;
position: relative;

@media screen and (width <= 850px) {
margin-right: 10px;
}

}

.menu_option {
Expand Down
24 changes: 15 additions & 9 deletions src/renderer/assets/styles/publicationInfos.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
border: 1px solid var(--color-blue);
height: 25px;
border-radius: 4px;
padding: 2px;
padding: 4px;
width: 100%;
display: flex;
align-items: center;
Expand All @@ -76,23 +76,27 @@
}

.publicationInfo_leftSide {
// flex: 1;
flex: 1;
max-width: 35%;
text-align: center;
width: 100%;

&_coverWrapper {
width: 100%;
min-height: 350px;
position: relative;
display: flex;
align-items: center;
background-color: var(--color-extralight-grey);
border: 1px solid var(--color-light-grey);
border-radius: 6px;
margin: auto;

img {
min-height: 250px;
height: 100%;
min-width: 167px;
}

.no_img_wrapper {
height: 350px;
width: 100%;
aspect-ratio: 0.67;
text-align: center;
box-sizing: border-box;
padding: 5%;
Expand All @@ -106,16 +110,17 @@
border: 1px black solid;
width: 100%;
height: 100%;
line-height: inital;
line-height: initial;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;

& p {
word-break: break-all;
word-break: break-word;
display: -webkit-inline-box;
-webkit-line-clamp: 3;
line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-align: center;
Expand Down Expand Up @@ -156,6 +161,7 @@

.book_title {
font-size: 24px;
overflow-wrap: anywhere;
}

h2 {
Expand Down
7 changes: 4 additions & 3 deletions src/renderer/common/components/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface MyComboBoxProps<T extends object>
svg?: ISVGProps;
refInputEl?: React.Ref<HTMLInputElement>;
placeholder?: string;
customWidth?: number;
}

// function forwardRef<T extends object>(
Expand Down Expand Up @@ -56,17 +57,17 @@ export interface MyComboBoxProps<T extends object>
// );

export function ComboBox<T extends object>(
{ label, description, errorMessage, children, svg, refInputEl, placeholder, ...props }: MyComboBoxProps<T>,
{ label, description, errorMessage, children, svg, refInputEl, placeholder, customWidth, ...props }: MyComboBoxProps<T>,
) {

return (
<ComboBoxReactAria {...props} className={StylesCombobox.react_aria_ComboBox}>
<ComboBoxReactAria {...props} className={StylesCombobox.react_aria_ComboBox} style={{width: customWidth ? `${customWidth + 20}px` : ""}}>
{
label ?
<Label className={StylesCombobox.react_aria_Label}>{label}</Label>
: <></>
}
<Group className={classNames(StylesCombobox.my_combobox_container, "R2_CSS_CLASS__FORCE_NO_FOCUS_OUTLINE")} >
<Group className={classNames(StylesCombobox.my_combobox_container, "R2_CSS_CLASS__FORCE_NO_FOCUS_OUTLINE")} style={{width: customWidth ? `${customWidth}px` : ""}}>
{svg ? <SVG ariaHidden svg={svg} /> : <></>}
<Input className={classNames(StylesCombobox.react_aria_Input, "R2_CSS_CLASS__FORCE_NO_FOCUS_OUTLINE")} ref={refInputEl} placeholder={placeholder} />
{(!props.defaultItems || !!Array(...(props.defaultItems || [])).length) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class AddTag extends React.Component<IProps, IState> {
inputValue={this.state.tagName}
defaultInputValue={this.state.tagName}
aria-labe={__("catalog.addTags")}
customWidth={250}
>
{item => <ComboBoxItem>{item.name}</ComboBoxItem>}
</ComboBox>
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/reader/components/Reader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,9 @@ class Reader extends React.Component<IProps, IState> {
: this.props.readerConfig.readerDockingMode === "right" ? !this.props.readerConfig.paged ? stylesReader.docked_right_scrollable : stylesReader.docked_right_pdf
: ""
) : undefined,
(this.props.searchEnable && !this.props.isPdf) ? stylesReader.isOnSearch
: (this.props.searchEnable && this.props.isPdf) ? stylesReader.isOnSearchPdf
(this.props.searchEnable && !this.props.isPdf && this.props.readerConfig.paged) ? stylesReader.isOnSearch
: (this.props.searchEnable && this.props.isPdf) ? stylesReader.isOnSearchPdf :
(this.props.searchEnable && !this.props.readerConfig.paged) ? stylesReader.isOnSearchScroll
: "")}
ref={this.mainElRef}
style={{ inset: isAudioBook || !this.props.readerConfig.paged || this.props.isPdf || this.props.isDivina ? "0" : "75px 50px" }}>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/reader/components/ReaderHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ export class ReaderHeader extends React.Component<IProps, IState> {
</button>
</Popover.Trigger>
<Popover.Portal>
<Popover.Content>
<Popover.Content style={{zIndex: 100}}>
<div className={stylesReaderHeader.Tts_popover_container}>
<div style={{paddingRight: "25px", borderRight: "1px solid var(--color-verylight-grey-alt)"}}>
<div className={stylesReader.ttsSelectRate}>
Expand Down

0 comments on commit 59e5a71

Please sign in to comment.