forked from Archives/Athou_commafeed
add option to keep some entries above the selected entry when scrolling
This commit is contained in:
@@ -78,6 +78,8 @@ public class UserSettings extends AbstractModel {
|
||||
@Column(nullable = false)
|
||||
private ScrollMode scrollMode;
|
||||
|
||||
private int entriesToKeepOnTopWhenScrolling;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(nullable = false)
|
||||
private IconDisplayMode starIconDisplayMode;
|
||||
|
||||
@@ -49,6 +49,9 @@ public class Settings implements Serializable {
|
||||
requiredMode = RequiredMode.REQUIRED)
|
||||
private String scrollMode;
|
||||
|
||||
@Schema(description = "number of entries to keep above the selected entry when scrolling", requiredMode = RequiredMode.REQUIRED)
|
||||
private int entriesToKeepOnTopWhenScrolling;
|
||||
|
||||
@Schema(
|
||||
description = "whether to show the star icon in the header of entries",
|
||||
allowableValues = "always,never,on_desktop,on_mobile",
|
||||
|
||||
@@ -114,6 +114,7 @@ public class UserREST {
|
||||
s.setLanguage(settings.getLanguage());
|
||||
s.setScrollSpeed(settings.getScrollSpeed());
|
||||
s.setScrollMode(settings.getScrollMode().name());
|
||||
s.setEntriesToKeepOnTopWhenScrolling(settings.getEntriesToKeepOnTopWhenScrolling());
|
||||
s.setStarIconDisplayMode(settings.getStarIconDisplayMode().name());
|
||||
s.setExternalLinkIconDisplayMode(settings.getExternalLinkIconDisplayMode().name());
|
||||
s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation());
|
||||
@@ -139,6 +140,7 @@ public class UserREST {
|
||||
s.setLanguage("en");
|
||||
s.setScrollSpeed(400);
|
||||
s.setScrollMode(ScrollMode.if_needed.name());
|
||||
s.setEntriesToKeepOnTopWhenScrolling(0);
|
||||
s.setStarIconDisplayMode(IconDisplayMode.on_desktop.name());
|
||||
s.setExternalLinkIconDisplayMode(IconDisplayMode.on_desktop.name());
|
||||
s.setMarkAllAsReadConfirmation(true);
|
||||
@@ -172,6 +174,7 @@ public class UserREST {
|
||||
s.setLanguage(settings.getLanguage());
|
||||
s.setScrollSpeed(settings.getScrollSpeed());
|
||||
s.setScrollMode(ScrollMode.valueOf(settings.getScrollMode()));
|
||||
s.setEntriesToKeepOnTopWhenScrolling(settings.getEntriesToKeepOnTopWhenScrolling());
|
||||
s.setStarIconDisplayMode(IconDisplayMode.valueOf(settings.getStarIconDisplayMode()));
|
||||
s.setExternalLinkIconDisplayMode(IconDisplayMode.valueOf(settings.getExternalLinkIconDisplayMode()));
|
||||
s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation());
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
|
||||
|
||||
<changeSet id="entriesToKeepOnTopWhenScrolling-setting" author="athou">
|
||||
<addColumn tableName="USERSETTINGS">
|
||||
<column name="entriesToKeepOnTopWhenScrolling" type="INT" valueNumeric="0">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
@@ -32,5 +32,6 @@
|
||||
<include file="changelogs/db.changelog-4.3.xml" />
|
||||
<include file="changelogs/db.changelog-4.4.xml" />
|
||||
<include file="changelogs/db.changelog-5.1.xml" />
|
||||
<include file="changelogs/db.changelog-5.2.xml" />
|
||||
|
||||
</databaseChangeLog>
|
||||
Reference in New Issue
Block a user