Открыть боковую панель
Aurora OS
Demos
UI Component Gallery
Коммиты
1a52ecee
Коммит
1a52ecee
создал
Янв 24, 2024
по автору
Aleksandr Komakhin
Зафиксировано автором
Alexey Andreev
Фев 06, 2024
Просмотр файлов
[Haptic] Add vibro presets.
#29
владелец
7c4eca53
Изменения
3
Скрыть пробелы
Построчно
Рядом
qml/pages/HapticPage.qml
Просмотр файла @
1a52ecee
// SPDX-FileCopyrightText: 2023 Open Mobile Platform LLC <community@omp.ru>
// SPDX-FileCopyrightText: 2023
- 2024
Open Mobile Platform LLC <community@omp.ru>
// SPDX-FileCopyrightText: 2013 Jolla Ltd
// SPDX-License-Identifier: BSD-3-Clause
import
QtQuick
2.0
import
QtQuick
.
Layouts
1.0
import
QtFeedback
5.0
import
Sailfish
.
Silica
1.0
Page
{
id
:
page
ThemeEffect
{
id
:
buttonBuzz
effect
:
ThemeEffect
.
Press
}
property
var
effects
:
[
ThemeEffect
.
Press
,
ThemeEffect
.
Release
,
ThemeEffect
.
PressWeak
,
ThemeEffect
.
ReleaseWeak
,
ThemeEffect
.
PressStrong
,
ThemeEffect
.
ReleaseStrong
,
ThemeEffect
.
DragStart
,
ThemeEffect
.
DragDropInZone
,
ThemeEffect
.
DragDropOutOfZone
,
ThemeEffect
.
DragCrossBoundary
,
ThemeEffect
.
Appear
,
ThemeEffect
.
Disappear
,
ThemeEffect
.
Move
]
ThemeEffect
{
id
:
keypadBuzz
effect
:
ThemeEffect
.
PressWeak
}
property
var
effectsDescription
:
[
//% "Press / Button"
qsTrId
(
"
ui-component-gallery-haptic-press-button
"
),
//% "Release"
qsTrId
(
"
ui-component-gallery-haptic-release
"
),
//% "PressWeak / Keypad"
qsTrId
(
"
ui-component-gallery-haptic-press-weak-keypad
"
),
//% "ReleaseWeak"
qsTrId
(
"
ui-component-gallery-haptic-release-weak
"
),
//% "PressStrong / Long"
qsTrId
(
"
ui-component-gallery-haptic-press-strong-long
"
),
//% "ReleaseStrong"
qsTrId
(
"
ui-component-gallery-haptic-release-strong
"
),
//% "DragStart"
qsTrId
(
"
ui-component-gallery-haptic-drag-start
"
),
//% "DragDropInZone"
qsTrId
(
"
ui-component-gallery-haptic-drag-drop-in-zone
"
),
//% "DragDropOutOfZone"
qsTrId
(
"
ui-component-gallery-haptic-drag-drop-out-of-zone
"
),
//% "DragCrossBoundary"
qsTrId
(
"
ui-component-gallery-haptic-drag-cross-boundary
"
),
//% "Appear"
qsTrId
(
"
ui-component-gallery-haptic-appear
"
),
//% "Disappear"
qsTrId
(
"
ui-component-gallery-haptic-disappear
"
),
//% "Move"
qsTrId
(
"
ui-component-gallery-haptic-move
"
)]
ThemeEffect
{
id
:
longBuzz
effect
:
ThemeEffect
.
PressStrong
id
:
customVibro
}
HapticsEffect
{
...
...
@@ -55,31 +75,12 @@ Page {
spacing
:
Theme
.
paddingLarge
PageHeader
{
//% "Haptics"
title
:
qsTrId
(
"
ui-component-gallery-haptic-haptics
"
)
title
:
"
Haptics
"
}
SectionHeader
{
//% "Theme effects, onPressed"
text
:
qsTrId
(
"
ui-component-gallery-haptic-theme-effects-on-pressed
"
)
}
Button
{
//% "Long"
text
:
qsTrId
(
"
ui-component-gallery-haptic-long
"
)
anchors.horizontalCenter
:
parent
.
horizontalCenter
onPressed
:
longBuzz
.
play
()
}
Button
{
//% "Button"
text
:
qsTrId
(
"
ui-component-gallery-haptic-button
"
)
anchors.horizontalCenter
:
parent
.
horizontalCenter
onPressed
:
buttonBuzz
.
play
()
}
Button
{
//% "Keypad"
text
:
qsTrId
(
"
ui-component-gallery-haptic-keypad
"
)
anchors.horizontalCenter
:
parent
.
horizontalCenter
onPressed
:
keypadBuzz
.
play
()
//% "Custom effects"
text
:
qsTrId
(
"
ui-component-gallery-haptic-custom-effects
"
)
}
Button
{
//% "Periodic"
...
...
@@ -87,10 +88,6 @@ Page {
anchors.horizontalCenter
:
parent
.
horizontalCenter
onPressed
:
periodicBuzz
.
start
()
}
SectionHeader
{
//% "Custom effects"
text
:
qsTrId
(
"
ui-component-gallery-haptic-custom-effects
"
)
}
Label
{
x
:
Theme
.
horizontalPageMargin
//% "Effect duration:"
...
...
@@ -142,6 +139,26 @@ Page {
onPressed
:
customBuzz
.
start
()
onReleased
:
customBuzz
.
start
()
}
SectionHeader
{
//% "onPressed effects (Qt name / Theme name)"
text
:
qsTrId
(
"
ui-component-gallery-haptic-on-pressed-effects-qt-name-theme-name
"
)
}
GridLayout
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
width
:
page
.
width
-
Theme
.
paddingMedium
*
2
columns
:
2
rowSpacing
:
Theme
.
paddingLarge
Repeater
{
model
:
effects
Button
{
preferredWidth
:
Theme
.
buttonWidthExtraSmall
text
:
effectsDescription
[
index
]
onPressed
:
customVibro
.
play
(
effects
[
index
])
}
}
}
}
}
}
translations/ru.auroraos.UiComponentGallery-ru.ts
Просмотр файла @
1a52ecee
...
...
@@ -1106,26 +1106,6 @@
<
source
>
mind
-
boggling
<
/source
>
<
translation
>
ошеломляюще
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-haptics
"
>
<
source
>
Haptics
<
/source
>
<
translation
>
Тактильная
связь
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-theme-effects-on-pressed
"
>
<
source
>
Theme
effects
,
onPressed
<
/source
>
<
translation
>
Эффекты
темы
по
нажатию
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-long
"
>
<
source
>
Long
<
/source
>
<
translation
>
Долгий
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-button
"
>
<
source
>
Button
<
/source
>
<
translation
>
Кнопка
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-keypad
"
>
<
source
>
Keypad
<
/source
>
<
translation
>
Клавиатура
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-periodic
"
>
<
source
>
Periodic
<
/source
>
<
translation
>
Периодический
<
/translation
>
...
...
@@ -3766,5 +3746,61 @@
<
source
>
Pop
attached
<
/source
>
<
translation
>
Исключить
прикрепленную
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-on-pressed-effects-qt-name-theme-name
"
>
<
source
>
onPressed
effects
(
Qt
name
/
Theme
name
)
<
/source
>
<
translation
>
Эффекты
onPressed
(
наименование
Qt
/
наименование
Theme
)
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-press-button
"
>
<
source
>
Press
/
Button
<
/source
>
<
translation
>
Press
/
Button
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-release
"
>
<
source
>
Release
<
/source
>
<
translation
>
Release
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-press-weak-keypad
"
>
<
source
>
PressWeak
/
Keypad
<
/source
>
<
translation
>
PressWeak
/
Keypad
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-release-weak
"
>
<
source
>
ReleaseWeak
<
/source
>
<
translation
>
ReleaseWeak
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-press-strong-long
"
>
<
source
>
PressStrong
/
Long
<
/source
>
<
translation
>
PressStrong
/
Long
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-release-strong
"
>
<
source
>
ReleaseStrong
<
/source
>
<
translation
>
ReleaseStrong
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-drag-start
"
>
<
source
>
DragStart
<
/source
>
<
translation
>
DragStart
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-drag-drop-in-zone
"
>
<
source
>
DragDropInZone
<
/source
>
<
translation
>
DragDropInZone
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-drag-drop-out-of-zone
"
>
<
source
>
DragDropOutOfZone
<
/source
>
<
translation
>
DragDropOutOfZone
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-drag-cross-boundary
"
>
<
source
>
DragCrossBoundary
<
/source
>
<
translation
>
DragCrossBoundary
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-appear
"
>
<
source
>
Appear
<
/source
>
<
translation
>
Appear
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-disappear
"
>
<
source
>
Disappear
<
/source
>
<
translation
>
Disappear
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-move
"
>
<
source
>
Move
<
/source
>
<
translation
>
Move
<
/translation
>
<
/message
>
<
/context
>
<
/TS
>
translations/ru.auroraos.UiComponentGallery.ts
Просмотр файла @
1a52ecee
...
...
@@ -1106,26 +1106,6 @@
<source>mind-boggling</source>
<translation>mind-boggling</translation>
</message>
<
message
id
=
"
ui-component-gallery-haptic-haptics
"
>
<
source
>
Haptics
<
/source
>
<
translation
>
Haptics
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-theme-effects-on-pressed
"
>
<
source
>
Theme
effects
,
onPressed
<
/source
>
<
translation
>
Theme
effects
,
onPressed
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-long
"
>
<
source
>
Long
<
/source
>
<
translation
>
Long
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-button
"
>
<
source
>
Button
<
/source
>
<
translation
>
Button
<
/translation
>
<
/message
>
<
message
id
=
"
ui-component-gallery-haptic-keypad
"
>
<
source
>
Keypad
<
/source
>
<
translation
>
Keypad
<
/translation
>
<
/message
>
<message id="ui-component-gallery-haptic-periodic">
<source>Periodic</source>
<translation>Periodic</translation>
...
...
@@ -3766,5 +3746,61 @@
<source>Pop attached</source>
<translation>Pop attached</translation>
</message>
<message id="ui-component-gallery-haptic-on-pressed-effects-qt-name-theme-name">
<source>onPressed effects (Qt name / Theme name)</source>
<translation>onPressed effects (Qt name / Theme name)</translation>
</message>
<message id="ui-component-gallery-haptic-press-button">
<source>Press / Button</source>
<translation>Press / Button</translation>
</message>
<message id="ui-component-gallery-haptic-release">
<source>Release</source>
<translation>Release</translation>
</message>
<message id="ui-component-gallery-haptic-press-weak-keypad">
<source>PressWeak / Keypad</source>
<translation>PressWeak / Keypad</translation>
</message>
<message id="ui-component-gallery-haptic-release-weak">
<source>ReleaseWeak</source>
<translation>ReleaseWeak</translation>
</message>
<message id="ui-component-gallery-haptic-press-strong-long">
<source>PressStrong / Long</source>
<translation>PressStrong / Long</translation>
</message>
<message id="ui-component-gallery-haptic-release-strong">
<source>ReleaseStrong</source>
<translation>ReleaseStrong</translation>
</message>
<message id="ui-component-gallery-haptic-drag-start">
<source>DragStart</source>
<translation>DragStart</translation>
</message>
<message id="ui-component-gallery-haptic-drag-drop-in-zone">
<source>DragDropInZone</source>
<translation>DragDropInZone</translation>
</message>
<message id="ui-component-gallery-haptic-drag-drop-out-of-zone">
<source>DragDropOutOfZone</source>
<translation>DragDropOutOfZone</translation>
</message>
<message id="ui-component-gallery-haptic-drag-cross-boundary">
<source>DragCrossBoundary</source>
<translation>DragCrossBoundary</translation>
</message>
<message id="ui-component-gallery-haptic-appear">
<source>Appear</source>
<translation>Appear</translation>
</message>
<message id="ui-component-gallery-haptic-disappear">
<source>Disappear</source>
<translation>Disappear</translation>
</message>
<message id="ui-component-gallery-haptic-move">
<source>Move</source>
<translation>Move</translation>
</message>
</context>
</TS>
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать