Merge remote-tracking branch 'origin/main'

This commit is contained in:
Hosted Weblate 2026-05-09 09:38:02 +02:00
commit c9eb0bbb64
No known key found for this signature in database
GPG key ID: A3FAAA06E6569B4C
3 changed files with 11 additions and 2 deletions

View file

@ -539,6 +539,7 @@ internal fun PdfPageComposable(
isActivePage: Boolean = true, isActivePage: Boolean = true,
isBubbleZoomModeActive: Boolean = false, isBubbleZoomModeActive: Boolean = false,
isStylusOnlyMode: Boolean = false, isStylusOnlyMode: Boolean = false,
stylusButtonHovering: Boolean = false,
isAutoScrollPlaying: Boolean = false, isAutoScrollPlaying: Boolean = false,
isHighlighterSnapEnabled: Boolean = false, isHighlighterSnapEnabled: Boolean = false,
userHighlights: List<PdfUserHighlight> = emptyList(), userHighlights: List<PdfUserHighlight> = emptyList(),
@ -3335,7 +3336,7 @@ internal fun PdfPageComposable(
"Page $pageIndex | Type: ${down.type} | isPrimary: ${buttons.isPrimaryPressed} | isSecondary: ${buttons.isSecondaryPressed} | isTertiary: ${buttons.isTertiaryPressed} | buttonsString: $buttons" "Page $pageIndex | Type: ${down.type} | isPrimary: ${buttons.isPrimaryPressed} | isSecondary: ${buttons.isSecondaryPressed} | isTertiary: ${buttons.isTertiaryPressed} | buttonsString: $buttons"
) )
val isEraserOverride = down.type == PointerType.Eraser || (down.type == PointerType.Stylus && currentEvent.buttons.isSecondaryPressed) val isEraserOverride = down.type == PointerType.Eraser || (down.type == PointerType.Stylus && (currentEvent.buttons.isSecondaryPressed || currentEvent.buttons.isPrimaryPressed || stylusButtonHovering))
isStylusEraserOverride = isEraserOverride isStylusEraserOverride = isEraserOverride
val dragPointerId = down.id val dragPointerId = down.id

View file

@ -242,6 +242,7 @@ internal fun PdfVerticalReader(
autoScrollSpeed: Float = 1.0f, autoScrollSpeed: Float = 1.0f,
onInteractionListener: () -> Unit = {}, onInteractionListener: () -> Unit = {},
isStylusOnlyMode: Boolean = false, isStylusOnlyMode: Boolean = false,
stylusButtonHovering: Boolean = false,
isHighlighterSnapEnabled: Boolean = false, isHighlighterSnapEnabled: Boolean = false,
userHighlights: List<PdfUserHighlight> = emptyList(), userHighlights: List<PdfUserHighlight> = emptyList(),
onHighlightAdd: (Int, Pair<Int, Int>, String, PdfHighlightColor) -> Unit = { _,_,_,_ -> }, onHighlightAdd: (Int, Pair<Int, Int>, String, PdfHighlightColor) -> Unit = { _,_,_,_ -> },
@ -994,7 +995,7 @@ internal fun PdfVerticalReader(
) )
val isEraserOverride = down.type == PointerType.Eraser || val isEraserOverride = down.type == PointerType.Eraser ||
(down.type == PointerType.Stylus && currentEvent.buttons.isSecondaryPressed) (down.type == PointerType.Stylus && (currentEvent.buttons.isSecondaryPressed || currentEvent.buttons.isPrimaryPressed || stylusButtonHovering))
isStylusEraserOverride = isEraserOverride isStylusEraserOverride = isEraserOverride
fun getPageAndPoint(screenOffset: Offset): Pair<Int, PdfPoint>? { fun getPageAndPoint(screenOffset: Offset): Pair<Int, PdfPoint>? {
@ -1730,6 +1731,7 @@ internal fun PdfVerticalReader(
selectedTool = selectedTool, selectedTool = selectedTool,
richTextController = richTextController, richTextController = richTextController,
isStylusOnlyMode = isStylusOnlyMode, isStylusOnlyMode = isStylusOnlyMode,
stylusButtonHovering = stylusButtonHovering,
isAutoScrollPlaying = isAutoScrollPlaying, isAutoScrollPlaying = isAutoScrollPlaying,
textBoxes = textBoxes.filter { it.pageIndex == page.index }, textBoxes = textBoxes.filter { it.pageIndex == page.index },
selectedTextBoxId = selectedTextBoxId, selectedTextBoxId = selectedTextBoxId,

View file

@ -3491,6 +3491,7 @@ fun PdfViewerScreen(
Scaffold( Scaffold(
contentWindowInsets = WindowInsets(0, 0, 0, 0), contentWindowInsets = WindowInsets(0, 0, 0, 0),
) { _ -> ) { _ ->
var stylusButtonHovering by remember { mutableStateOf(false) }
BoxWithConstraints( BoxWithConstraints(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()
@ -3508,6 +3509,9 @@ fun PdfViewerScreen(
"tertiary=${buttons.isTertiaryPressed}, back=${buttons.isBackPressed}, " + "tertiary=${buttons.isTertiaryPressed}, back=${buttons.isBackPressed}, " +
"forward=${buttons.isForwardPressed}" "forward=${buttons.isForwardPressed}"
) )
if (!change.pressed) {
stylusButtonHovering = buttons.isPrimaryPressed || buttons.isSecondaryPressed
}
} }
} }
} }
@ -3914,6 +3918,7 @@ fun PdfViewerScreen(
}, },
richTextController = richTextController, richTextController = richTextController,
isStylusOnlyMode = isStylusOnlyMode, isStylusOnlyMode = isStylusOnlyMode,
stylusButtonHovering = stylusButtonHovering,
isAutoScrollPlaying = isAutoScrollPlaying, isAutoScrollPlaying = isAutoScrollPlaying,
isHighlighterSnapEnabled = isHighlighterSnapEnabled, isHighlighterSnapEnabled = isHighlighterSnapEnabled,
isEditMode = isDrawingActive, isEditMode = isDrawingActive,
@ -4321,6 +4326,7 @@ fun PdfViewerScreen(
selectedTool = selectedTool, selectedTool = selectedTool,
richTextController = richTextController, richTextController = richTextController,
isStylusOnlyMode = isStylusOnlyMode, isStylusOnlyMode = isStylusOnlyMode,
stylusButtonHovering = stylusButtonHovering,
isEditMode = isDrawingActive, isEditMode = isDrawingActive,
textBoxes = textBoxes, textBoxes = textBoxes,
selectedTextBoxId = selectedTextBoxId, selectedTextBoxId = selectedTextBoxId,