mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 19:42:17 +02:00
fg colors for highlightings (in progress)
This commit is contained in:
parent
6f06b9bc3f
commit
3720f8934c
44 changed files with 140 additions and 51 deletions
|
@ -642,7 +642,8 @@
|
|||
<node name="text" value="النص العادي"/>
|
||||
<node name="hyperlink" value="الروابط"/>
|
||||
<node name="hyperlinkVisited" value="الروابط التي تمت زيارتها"/>
|
||||
<node name="highlighting" value="خلفية نتائج البحث"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="خلفية نتائج البحث"/>
|
||||
<node name="footer" value="الحاشية"/>
|
||||
</node>
|
||||
<node name="margins" value="الهوامش">
|
||||
|
|
|
@ -650,7 +650,8 @@
|
|||
<node name="text" value="Звычайны тэкст"/>
|
||||
<node name="hyperlink" value="Тэкст спасылкі"/>
|
||||
<node name="hyperlinkVisited" value="Тэкст наведанай спасылкі"/>
|
||||
<node name="highlighting" value="Фон вынікаў пошуку"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Фон вынікаў пошуку"/>
|
||||
<node name="footer" value="Прыпятак"/>
|
||||
</node>
|
||||
<node name="margins" value="Палі">
|
||||
|
|
|
@ -650,7 +650,8 @@
|
|||
<node name="text" value="Нормален текст"/>
|
||||
<node name="hyperlink" value="Препратка"/>
|
||||
<node name="hyperlinkVisited" value="Посетена препратка"/>
|
||||
<node name="highlighting" value="Фон на резултата от търсенето"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Фон на резултата от търсенето"/>
|
||||
<node name="footer" value="Долен колонтитул"/>
|
||||
</node>
|
||||
<node name="margins" value="Граници">
|
||||
|
|
|
@ -650,7 +650,8 @@
|
|||
<node name="text" value="Text"/>
|
||||
<node name="hyperlink" value="Hipervincle"/>
|
||||
<node name="hyperlinkVisited" value="Hipervincle visitat"/>
|
||||
<node name="highlighting" value="Fons dels resultats de cerca"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Fons dels resultats de cerca"/>
|
||||
<node name="footer" value="Peu de pàgina"/>
|
||||
</node>
|
||||
<node name="margins" value="Marges">
|
||||
|
|
|
@ -653,7 +653,8 @@
|
|||
<node name="text" value="Běžný text"/>
|
||||
<node name="hyperlink" value="Hypertextový odkaz"/>
|
||||
<node name="hyperlinkVisited" value="Navštívený hypertextový odkaz"/>
|
||||
<node name="highlighting" value="Pozadí výsledků vyhledávání"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Pozadí výsledků vyhledávání"/>
|
||||
<node name="footer" value="Patička"/>
|
||||
</node>
|
||||
<node name="margins" value="Okraje">
|
||||
|
|
|
@ -644,7 +644,8 @@
|
|||
<node name="text" value="Almindelig tekst"/>
|
||||
<node name="hyperlink" value="Hyperlink-tekst"/>
|
||||
<node name="hyperlinkVisited" value="Besøgt hyperlink-tekst"/>
|
||||
<node name="highlighting" value="Søgeresultat-baggrund"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Søgeresultat-baggrund"/>
|
||||
<node name="footer" value="Sidefod"/>
|
||||
</node>
|
||||
<node name="margins" value="Margener">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- German FBReaderJ resources, by Victor Massini -->
|
||||
<!-- Updated by Ingolf Kübler 2010/11/17 -->
|
||||
<!-- Updated by Ingolf Kübler 2011/06/26 -->
|
||||
|
@ -650,7 +650,8 @@
|
|||
<node name="text" value="Normaler Text"/>
|
||||
<node name="hyperlink" value="Hyperlinks"/>
|
||||
<node name="hyperlinkVisited" value="Besuchte Hyperlinks"/>
|
||||
<node name="highlighting" value="Hintergrund der Suchergebnisse"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Hintergrund der Suchergebnisse"/>
|
||||
<node name="footer" value="Fußzeile"/>
|
||||
</node>
|
||||
<node name="margins" value="Ränder">
|
||||
|
|
|
@ -634,7 +634,8 @@
|
|||
<node name="text" value="Κανονικό κείμενο"/>
|
||||
<node name="hyperlink" value="Υπερ-σύνδεσμοι"/>
|
||||
<node name="hyperlinkVisited" value="Επισκεπτόμενοι Υπερ-σύνδεσμοι"/>
|
||||
<node name="highlighting" value="Παρασκήνιο των αποτελεσμάτων"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Παρασκήνιο των αποτελεσμάτων"/>
|
||||
<node name="footer" value="Υποσέλιδο"/>
|
||||
</node>
|
||||
<node name="margins" value="Άκρα">
|
||||
|
|
|
@ -644,7 +644,8 @@
|
|||
<node name="text" value="Regular text"/>
|
||||
<node name="hyperlink" value="Hyperlink text"/>
|
||||
<node name="hyperlinkVisited" value="Visited hyperlink text"/>
|
||||
<node name="highlighting" value="Search results background"/>
|
||||
<node name="highlightingForeground" value="Search results"/>
|
||||
<node name="highlightingBackground" value="Search results background"/>
|
||||
<node name="footer" value="Footer"/>
|
||||
</node>
|
||||
<node name="margins" value="Margins">
|
||||
|
|
|
@ -649,7 +649,8 @@
|
|||
<node name="text" value="Texto normal"/>
|
||||
<node name="hyperlink" value="Texto de hipervínculo"/>
|
||||
<node name="hyperlinkVisited" value="Texto de hipervínculo visitado"/>
|
||||
<node name="highlighting" value="Fondo de resultados de búsqueda"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Fondo de resultados de búsqueda"/>
|
||||
<node name="footer" value="Pie de página"/>
|
||||
</node>
|
||||
<node name="margins" value="Márgenes">
|
||||
|
|
|
@ -644,7 +644,8 @@
|
|||
<node name="text" value="Testu normala"/>
|
||||
<node name="hyperlink" value="Lotura testua"/>
|
||||
<node name="hyperlinkVisited" value="Bisitatutako lotura testua"/>
|
||||
<node name="highlighting" value="Bilaketaren emaitzaren atzeko planoa"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Bilaketaren emaitzaren atzeko planoa"/>
|
||||
<node name="footer" value="Oin-oharra"/>
|
||||
</node>
|
||||
<node name="margins" value="Marjinak">
|
||||
|
|
|
@ -644,7 +644,8 @@
|
|||
<node name="text" value="متن عادي"/>
|
||||
<node name="hyperlink" value="متن هايپرلينك"/>
|
||||
<node name="hyperlinkVisited" value="متن هايپرلينك بازديد شده"/>
|
||||
<node name="highlighting" value="نتايج جستجوي زمينه"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="نتايج جستجوي زمينه"/>
|
||||
<node name="footer" value="زيربرگ"/>
|
||||
</node>
|
||||
<node name="margins" value="حاشيه ها">
|
||||
|
|
|
@ -637,7 +637,8 @@
|
|||
<node name="text" value="Texte normal"/>
|
||||
<node name="hyperlink" value="Text d'hyperlien"/>
|
||||
<node name="hyperlinkVisited" value="Lien hypertexte visité"/>
|
||||
<node name="highlighting" value="Arrière-plan des résultats de recherche"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Arrière-plan des résultats de recherche"/>
|
||||
<node name="footer" value="Pied de page"/>
|
||||
</node>
|
||||
<node name="margins" value="Marge">
|
||||
|
|
|
@ -634,7 +634,8 @@
|
|||
<node name="text" value="Texto normal"/>
|
||||
<node name="hyperlink" value="Texto de ligazón"/>
|
||||
<node name="hyperlinkVisited" value="Visited hyperlink text" toBeTranslated="true"/>
|
||||
<node name="highlighting" value="Resultado da busca de fondos"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Resultado da busca de fondos"/>
|
||||
<node name="footer" value="Rodapé"/>
|
||||
</node>
|
||||
<node name="margins" value="Marxes">
|
||||
|
|
|
@ -634,7 +634,8 @@
|
|||
<node name="text" value="Szöveg"/>
|
||||
<node name="hyperlink" value="Link"/>
|
||||
<node name="hyperlinkVisited" value="Meglátogatott link"/>
|
||||
<node name="highlighting" value="Találatok kiemelése"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Találatok kiemelése"/>
|
||||
<node name="footer" value="Lábléc"/>
|
||||
</node>
|
||||
<node name="margins" value="Margók">
|
||||
|
|
|
@ -649,7 +649,8 @@
|
|||
<node name="text" value="Կանոնավոր գրվածք"/>
|
||||
<node name="hyperlink" value="Գերհղում"/>
|
||||
<node name="hyperlinkVisited" value="Այցելված հղում"/>
|
||||
<node name="highlighting" value="Որոնման արդյունքների ետնաշերտը"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Որոնման արդյունքների ետնաշերտը"/>
|
||||
<node name="footer" value="Էջատակ"/>
|
||||
</node>
|
||||
<node name="margins" value="Լուսանցքներ">
|
||||
|
|
|
@ -635,7 +635,8 @@
|
|||
<node name="text" value="Testo Regolare"/>
|
||||
<node name="hyperlink" value="Testo Hyperlink"/>
|
||||
<node name="hyperlinkVisited" value="Testo collegamento visitato"/>
|
||||
<node name="highlighting" value="Risultati Ricerca Sfondo"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Risultati Ricerca Sfondo"/>
|
||||
<node name="footer" value="Piè di pagina"/>
|
||||
</node>
|
||||
<node name="margins" value="Margini">
|
||||
|
|
|
@ -644,7 +644,8 @@
|
|||
<node name="text" value="標準の文字"/>
|
||||
<node name="hyperlink" value="リンク文字"/>
|
||||
<node name="hyperlinkVisited" value="リンク文字 (訪問済み)"/>
|
||||
<node name="highlighting" value="検索結果の背景"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="検索結果の背景"/>
|
||||
<node name="footer" value="フッタ"/>
|
||||
</node>
|
||||
<node name="margins" value="マージン">
|
||||
|
|
|
@ -649,7 +649,8 @@
|
|||
<node name="text" value="ჩვეულებრივი ტექსტი"/>
|
||||
<node name="hyperlink" value="ჰიპერლინკი"/>
|
||||
<node name="hyperlinkVisited" value="მონახულებული ლინკი"/>
|
||||
<node name="highlighting" value="ძიების რეზულტატების ფონი"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="ძიების რეზულტატების ფონი"/>
|
||||
<node name="footer" value="სარდაფი"/>
|
||||
</node>
|
||||
<node name="margins" value="დაშორებები">
|
||||
|
|
|
@ -644,7 +644,8 @@
|
|||
<node name="text" value="Vanlig tekst"/>
|
||||
<node name="hyperlink" value="Hyperlenketekst"/>
|
||||
<node name="hyperlinkVisited" value="Besøkt hyperlenketekst"/>
|
||||
<node name="highlighting" value="Bakgrunn søkeresultat"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Bakgrunn søkeresultat"/>
|
||||
<node name="footer" value="Bunntekst"/>
|
||||
</node>
|
||||
<node name="margins" value="Marger">
|
||||
|
|
|
@ -644,7 +644,8 @@
|
|||
<node name="text" value="Normale tekst"/>
|
||||
<node name="hyperlink" value="Hyperlink tekst"/>
|
||||
<node name="hyperlinkVisited" value="Bezochte hyperlink tekst"/>
|
||||
<node name="highlighting" value="Achtergrond zoekresultaten"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Achtergrond zoekresultaten"/>
|
||||
<node name="footer" value="Voettekst"/>
|
||||
</node>
|
||||
<node name="margins" value="Marges">
|
||||
|
|
|
@ -634,7 +634,8 @@
|
|||
<node name="text" value="Zwykły tekst"/>
|
||||
<node name="hyperlink" value="Odsyłacz"/>
|
||||
<node name="hyperlinkVisited" value="Odwiedzony odsyłacz"/>
|
||||
<node name="highlighting" value="Tło wyszukanych elementów"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Tło wyszukanych elementów"/>
|
||||
<node name="footer" value="Stopka"/>
|
||||
</node>
|
||||
<node name="margins" value="Marginesy">
|
||||
|
|
|
@ -646,7 +646,8 @@
|
|||
<node name="text" value="Texto normal"/>
|
||||
<node name="hyperlink" value="Texto de hiperligação"/>
|
||||
<node name="hyperlinkVisited" value="Texto de hiperligação visitado"/>
|
||||
<node name="highlighting" value="Fundo de resultados de pesquisa"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Fundo de resultados de pesquisa"/>
|
||||
<node name="footer" value="Rodapé"/>
|
||||
</node>
|
||||
<node name="margins" value="Margens">
|
||||
|
|
|
@ -635,7 +635,8 @@
|
|||
<node name="text" value="Text obisnuit"/>
|
||||
<node name="hyperlink" value="Hyperlink Text"/>
|
||||
<node name="hyperlinkVisited" value="Textul hyperlinkului vizitat"/>
|
||||
<node name="highlighting" value="Rezultatele cautarii in fundal"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Rezultatele cautarii in fundal"/>
|
||||
<node name="footer" value="Subsol"/>
|
||||
</node>
|
||||
<node name="margins" value="Margini">
|
||||
|
|
|
@ -649,7 +649,8 @@
|
|||
<node name="text" value="Обычный текст"/>
|
||||
<node name="hyperlink" value="Гиперссылка"/>
|
||||
<node name="hyperlinkVisited" value="Посещенная ссылка"/>
|
||||
<node name="highlighting" value="Фон результатов поиска"/>
|
||||
<node name="highlightingForeground" value="Результаты поиска"/>
|
||||
<node name="highlightingBackground" value="Фон результатов поиска"/>
|
||||
<node name="footer" value="Подвал"/>
|
||||
</node>
|
||||
<node name="margins" value="Отступы">
|
||||
|
|
|
@ -644,7 +644,8 @@
|
|||
<node name="text" value="Нормал текст"/>
|
||||
<node name="hyperlink" value="Текст хипервезе"/>
|
||||
<node name="hyperlinkVisited" value="Посећен текст хипервезе"/>
|
||||
<node name="highlighting" value="Позадина резултата претраге"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Позадина резултата претраге"/>
|
||||
<node name="footer" value="Подножје"/>
|
||||
</node>
|
||||
<node name="margins" value="Маргине">
|
||||
|
|
|
@ -634,7 +634,8 @@
|
|||
<node name="text" value="ข้อความ"/>
|
||||
<node name="hyperlink" value="ลิ้งค์ข้อความ"/>
|
||||
<node name="hyperlinkVisited" value="Visited hyperlink text" toBeTranslated="true"/>
|
||||
<node name="highlighting" value="สีไฮไลท์ผลการค้นหาคำ"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="สีไฮไลท์ผลการค้นหาคำ"/>
|
||||
<node name="footer" value="ข้อความท้ายหน้า"/>
|
||||
</node>
|
||||
<node name="margins" value="ตั้งค่าขอบ">
|
||||
|
|
|
@ -644,7 +644,8 @@
|
|||
<node name="text" value="Normal metin"/>
|
||||
<node name="hyperlink" value="Link"/>
|
||||
<node name="hyperlinkVisited" value="Ziyaret edilmiş link"/>
|
||||
<node name="highlighting" value="Arama sonuçları arkaplanı"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Arama sonuçları arkaplanı"/>
|
||||
<node name="footer" value="Altbilgi"/>
|
||||
</node>
|
||||
<node name="margins" value="Aralıklar">
|
||||
|
|
|
@ -634,7 +634,8 @@
|
|||
<node name="text" value="Звичайний текст"/>
|
||||
<node name="hyperlink" value="Посилання"/>
|
||||
<node name="hyperlinkVisited" value="Переглянуті посилання"/>
|
||||
<node name="highlighting" value="Фон результатів пошуку"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Фон результатів пошуку"/>
|
||||
<node name="footer" value="Нижній колонтитул (підвал)"/>
|
||||
</node>
|
||||
<node name="margins" value="Відступи">
|
||||
|
|
|
@ -634,7 +634,8 @@
|
|||
<node name="text" value="Văn bản Thường"/>
|
||||
<node name="hyperlink" value="Siêu liên kết"/>
|
||||
<node name="hyperlinkVisited" value="Visited hyperlink text" toBeTranslated="true"/>
|
||||
<node name="highlighting" value="Kết quả Tìm kiếm"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="Kết quả Tìm kiếm"/>
|
||||
<node name="footer" value="Footer"/>
|
||||
</node>
|
||||
<node name="margins" value="Canh lề">
|
||||
|
|
|
@ -634,7 +634,8 @@
|
|||
<node name="text" value="普通文字"/>
|
||||
<node name="hyperlink" value="链接文字"/>
|
||||
<node name="hyperlinkVisited" value="已访问过的链接文字"/>
|
||||
<node name="highlighting" value="搜索结果背景"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="搜索结果背景"/>
|
||||
<node name="footer" value="页脚"/>
|
||||
</node>
|
||||
<node name="margins" value="边距">
|
||||
|
|
|
@ -634,7 +634,8 @@
|
|||
<node name="text" value="普通文字"/>
|
||||
<node name="hyperlink" value="超連結文字"/>
|
||||
<node name="hyperlinkVisited" value="已按超連結文字"/>
|
||||
<node name="highlighting" value="搜尋結果背景"/>
|
||||
<node name="highlightingForeground" value="Search results" toBeTranslated="true"/>
|
||||
<node name="highlightingBackground" value="搜尋結果背景"/>
|
||||
<node name="footer" value="頁尾"/>
|
||||
</node>
|
||||
<node name="margins" value="邊距">
|
||||
|
|
|
@ -76,7 +76,7 @@ final class SQLiteBooksDatabase extends BooksDatabase {
|
|||
|
||||
private void migrate() {
|
||||
final int version = myDatabase.getVersion();
|
||||
final int currentVersion = 28;
|
||||
final int currentVersion = 29;
|
||||
if (version >= currentVersion) {
|
||||
return;
|
||||
}
|
||||
|
@ -140,6 +140,8 @@ final class SQLiteBooksDatabase extends BooksDatabase {
|
|||
updateTables26();
|
||||
case 27:
|
||||
updateTables27();
|
||||
case 28:
|
||||
updateTables28();
|
||||
}
|
||||
myDatabase.setTransactionSuccessful();
|
||||
myDatabase.setVersion(currentVersion);
|
||||
|
@ -833,13 +835,14 @@ final class SQLiteBooksDatabase extends BooksDatabase {
|
|||
@Override
|
||||
protected List<HighlightingStyle> loadStyles() {
|
||||
final LinkedList<HighlightingStyle> list = new LinkedList<HighlightingStyle>();
|
||||
final String sql = "SELECT style_id,name,bg_color FROM HighlightingStyle";
|
||||
final String sql = "SELECT style_id,name,bg_color,fg_color FROM HighlightingStyle";
|
||||
final Cursor cursor = myDatabase.rawQuery(sql, null);
|
||||
while (cursor.moveToNext()) {
|
||||
list.add(createStyle(
|
||||
(int)cursor.getLong(0),
|
||||
cursor.getString(1),
|
||||
(int)cursor.getLong(2)
|
||||
(int)cursor.getLong(2),
|
||||
(int)cursor.getLong(3)
|
||||
));
|
||||
}
|
||||
cursor.close();
|
||||
|
@ -848,13 +851,15 @@ final class SQLiteBooksDatabase extends BooksDatabase {
|
|||
|
||||
protected void saveStyle(HighlightingStyle style) {
|
||||
final SQLiteStatement statement = get(
|
||||
"INSERT OR REPLACE INTO HighlightingStyle (style_id,name,bg_color) VALUES (?,?,?)"
|
||||
"INSERT OR REPLACE INTO HighlightingStyle (style_id,name,bg_color,fg_color) VALUES (?,?,?,?)"
|
||||
);
|
||||
statement.bindLong(1, style.Id);
|
||||
final String name = style.getName();
|
||||
statement.bindString(2, name != null ? name : "");
|
||||
final ZLColor bgColor = style.getBackgroundColor();
|
||||
statement.bindLong(3, bgColor != null ? bgColor.intValue() : -1);
|
||||
final ZLColor fgColor = style.getForegroundColor();
|
||||
statement.bindLong(4, fgColor != null ? fgColor.intValue() : -1);
|
||||
statement.execute();
|
||||
}
|
||||
|
||||
|
@ -1484,6 +1489,10 @@ final class SQLiteBooksDatabase extends BooksDatabase {
|
|||
myDatabase.execSQL("ALTER TABLE BookState ADD COLUMN timestamp INTEGER");
|
||||
}
|
||||
|
||||
private void updateTables28() {
|
||||
myDatabase.execSQL("ALTER TABLE HighlightingStyle ADD COLUMN fg_color INTEGER NOT NULL DEFAULT -1");
|
||||
}
|
||||
|
||||
private SQLiteStatement get(String sql) {
|
||||
SQLiteStatement statement = myStatements.get(sql);
|
||||
if (statement == null) {
|
||||
|
|
|
@ -472,7 +472,8 @@ public class PreferenceActivity extends ZLPreferenceActivity {
|
|||
backgroundSet.add(colorsScreen.addOption(profile.FillModeOption, "fillMode"));
|
||||
backgroundSet.run();
|
||||
|
||||
colorsScreen.addOption(profile.HighlightingOption, "highlighting");
|
||||
//colorsScreen.addOption(profile.HighlightingForegroundOption, "highlightingForeground");
|
||||
colorsScreen.addOption(profile.HighlightingBackgroundOption, "highlightingBackground");
|
||||
colorsScreen.addOption(profile.RegularTextOption, "text");
|
||||
colorsScreen.addOption(profile.HyperlinkTextOption, "hyperlink");
|
||||
colorsScreen.addOption(profile.VisitedHyperlinkTextOption, "hyperlinkVisited");
|
||||
|
|
|
@ -119,8 +119,12 @@ public abstract class BooksDatabase {
|
|||
protected abstract long saveBookmark(Bookmark bookmark);
|
||||
protected abstract void deleteBookmark(Bookmark bookmark);
|
||||
|
||||
protected HighlightingStyle createStyle(int id, String name, int color) {
|
||||
return new HighlightingStyle(id, name, color != -1 ? new ZLColor(color) : null);
|
||||
protected HighlightingStyle createStyle(int id, String name, int bgColor, int fgColor) {
|
||||
return new HighlightingStyle(
|
||||
id, name,
|
||||
bgColor != -1 ? new ZLColor(bgColor) : null,
|
||||
fgColor != -1 ? new ZLColor(fgColor) : null
|
||||
);
|
||||
}
|
||||
protected abstract List<HighlightingStyle> loadStyles();
|
||||
protected abstract void saveStyle(HighlightingStyle style);
|
||||
|
|
|
@ -30,11 +30,12 @@ public class HighlightingStyle {
|
|||
|
||||
private String myName;
|
||||
private ZLColor myBackgroundColor;
|
||||
private ZLColor myForegroundColor;
|
||||
|
||||
HighlightingStyle(int id, String name, ZLColor bgColor) {
|
||||
HighlightingStyle(int id, String name, ZLColor bgColor, ZLColor fgColor) {
|
||||
Id = id;
|
||||
myName = name;
|
||||
myBackgroundColor = bgColor;
|
||||
myForegroundColor = fgColor;
|
||||
}
|
||||
|
||||
private String defaultName() {
|
||||
|
@ -59,4 +60,12 @@ public class HighlightingStyle {
|
|||
public void setBackgroundColor(ZLColor bgColor) {
|
||||
myBackgroundColor = bgColor;
|
||||
}
|
||||
|
||||
public ZLColor getForegroundColor() {
|
||||
return myForegroundColor;
|
||||
}
|
||||
|
||||
public void setForegroundColor(ZLColor fgColor) {
|
||||
myForegroundColor = fgColor;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -327,10 +327,12 @@ class XMLSerializer extends AbstractSerializer {
|
|||
public String serialize(HighlightingStyle style) {
|
||||
final StringBuilder buffer = new StringBuilder();
|
||||
final ZLColor bgColor = style.getBackgroundColor();
|
||||
final ZLColor fgColor = style.getForegroundColor();
|
||||
appendTag(buffer, "style", true,
|
||||
"id", String.valueOf(style.Id),
|
||||
"name", style.getName(),
|
||||
"bg-color", bgColor != null ? String.valueOf(bgColor.intValue()) : "-1"
|
||||
"bg-color", bgColor != null ? String.valueOf(bgColor.intValue()) : "-1",
|
||||
"fg-color", fgColor != null ? String.valueOf(fgColor.intValue()) : "-1"
|
||||
);
|
||||
return buffer.toString();
|
||||
}
|
||||
|
@ -1026,10 +1028,12 @@ class XMLSerializer extends AbstractSerializer {
|
|||
if ("style".equals(localName)) {
|
||||
final int id = parseIntSafe(attributes.getValue("id"), -1);
|
||||
if (id != -1) {
|
||||
final int rgb = parseIntSafe(attributes.getValue("bg-color"), -1);
|
||||
final ZLColor color = rgb != -1 ? new ZLColor(rgb) : null;
|
||||
final int bg = parseIntSafe(attributes.getValue("bg-color"), -1);
|
||||
final int fg = parseIntSafe(attributes.getValue("fg-color"), -1);
|
||||
myStyle = new HighlightingStyle(
|
||||
id, attributes.getValue("name"), color
|
||||
id, attributes.getValue("name"),
|
||||
bg != -1 ? new ZLColor(bg) : null,
|
||||
fg != -1 ? new ZLColor(fg) : null
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,4 +53,10 @@ public final class BookmarkHighlighting extends ZLTextSimpleHighlighting {
|
|||
final HighlightingStyle bmStyle = Collection.getHighlightingStyle(Bookmark.getStyleId());
|
||||
return bmStyle != null ? bmStyle.getBackgroundColor() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZLColor getForegroundColor() {
|
||||
final HighlightingStyle bmStyle = Collection.getHighlightingStyle(Bookmark.getStyleId());
|
||||
return bmStyle != null ? bmStyle.getForegroundColor() : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -444,7 +444,12 @@ public final class FBView extends ZLTextView {
|
|||
|
||||
@Override
|
||||
public ZLColor getHighlightingBackgroundColor() {
|
||||
return myViewOptions.getColorProfile().HighlightingOption.getValue();
|
||||
return myViewOptions.getColorProfile().HighlightingBackgroundOption.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZLColor getHighlightingForegroundColor() {
|
||||
return myViewOptions.getColorProfile().HighlightingForegroundOption.getValue();
|
||||
}
|
||||
|
||||
private class Footer implements FooterArea {
|
||||
|
|
|
@ -61,7 +61,8 @@ public class ColorProfile {
|
|||
public final ZLColorOption BackgroundOption;
|
||||
public final ZLColorOption SelectionBackgroundOption;
|
||||
public final ZLColorOption SelectionForegroundOption;
|
||||
public final ZLColorOption HighlightingOption;
|
||||
public final ZLColorOption HighlightingForegroundOption;
|
||||
public final ZLColorOption HighlightingBackgroundOption;
|
||||
public final ZLColorOption RegularTextOption;
|
||||
public final ZLColorOption HyperlinkTextOption;
|
||||
public final ZLColorOption VisitedHyperlinkTextOption;
|
||||
|
@ -74,7 +75,8 @@ public class ColorProfile {
|
|||
BackgroundOption.setValue(base.BackgroundOption.getValue());
|
||||
SelectionBackgroundOption.setValue(base.SelectionBackgroundOption.getValue());
|
||||
SelectionForegroundOption.setValue(base.SelectionForegroundOption.getValue());
|
||||
HighlightingOption.setValue(base.HighlightingOption.getValue());
|
||||
HighlightingForegroundOption.setValue(base.HighlightingForegroundOption.getValue());
|
||||
HighlightingBackgroundOption.setValue(base.HighlightingBackgroundOption.getValue());
|
||||
RegularTextOption.setValue(base.RegularTextOption.getValue());
|
||||
HyperlinkTextOption.setValue(base.HyperlinkTextOption.getValue());
|
||||
VisitedHyperlinkTextOption.setValue(base.VisitedHyperlinkTextOption.getValue());
|
||||
|
@ -98,8 +100,10 @@ public class ColorProfile {
|
|||
createOption(name, "SelectionBackground", 82, 131, 194);
|
||||
SelectionForegroundOption =
|
||||
createOption(name, "SelectionForeground", 255, 255, 220);
|
||||
HighlightingOption =
|
||||
HighlightingBackgroundOption =
|
||||
createOption(name, "Highlighting", 96, 96, 128);
|
||||
HighlightingForegroundOption =
|
||||
createOption(name, "HighlightingForeground", 192, 192, 192);
|
||||
RegularTextOption =
|
||||
createOption(name, "Text", 192, 192, 192);
|
||||
HyperlinkTextOption =
|
||||
|
@ -119,8 +123,10 @@ public class ColorProfile {
|
|||
createOption(name, "SelectionBackground", 82, 131, 194);
|
||||
SelectionForegroundOption =
|
||||
createOption(name, "SelectionForeground", 255, 255, 220);
|
||||
HighlightingOption =
|
||||
HighlightingBackgroundOption =
|
||||
createOption(name, "Highlighting", 255, 192, 128);
|
||||
HighlightingForegroundOption =
|
||||
createOption(name, "HighlightingForeground", 0, 0, 0);
|
||||
RegularTextOption =
|
||||
createOption(name, "Text", 0, 0, 0);
|
||||
HyperlinkTextOption =
|
||||
|
|
|
@ -29,6 +29,7 @@ public abstract class ZLTextHighlighting implements Comparable<ZLTextHighlightin
|
|||
public abstract ZLTextElementArea getStartArea(ZLTextPage page);
|
||||
public abstract ZLTextElementArea getEndArea(ZLTextPage page);
|
||||
|
||||
public abstract ZLColor getForegroundColor();
|
||||
public abstract ZLColor getBackgroundColor();
|
||||
|
||||
boolean intersects(ZLTextPage page) {
|
||||
|
|
|
@ -30,4 +30,9 @@ class ZLTextManualHighlighting extends ZLTextSimpleHighlighting {
|
|||
public ZLColor getBackgroundColor() {
|
||||
return View.getHighlightingBackgroundColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZLColor getForegroundColor() {
|
||||
return View.getHighlightingForegroundColor();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -276,6 +276,11 @@ class ZLTextSelection extends ZLTextHighlighting {
|
|||
return myView.getSelectionBackgroundColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZLColor getForegroundColor() {
|
||||
return myView.getSelectionForegroundColor();
|
||||
}
|
||||
|
||||
private class Scroller implements Runnable {
|
||||
private final ZLTextPage myPage;
|
||||
private final boolean myScrollForward;
|
||||
|
|
|
@ -91,6 +91,7 @@ abstract class ZLTextViewBase extends ZLView {
|
|||
public abstract ZLColor getSelectionBackgroundColor();
|
||||
public abstract ZLColor getSelectionForegroundColor();
|
||||
public abstract ZLColor getHighlightingBackgroundColor();
|
||||
public abstract ZLColor getHighlightingForegroundColor();
|
||||
public abstract ZLColor getTextColor(ZLTextHyperlink hyperlink);
|
||||
|
||||
ZLPaintContext.Size getTextAreaSize() {
|
||||
|
@ -331,6 +332,7 @@ abstract class ZLTextViewBase extends ZLView {
|
|||
int endPos = Math.min(markStart + markLen, length);
|
||||
final int endX = x + context.getStringWidth(str, offset + markStart, endPos - markStart);
|
||||
context.fillRectangle(x, y - context.getStringHeight(), endX - 1, y + context.getDescent());
|
||||
context.setTextColor(getHighlightingForegroundColor());
|
||||
context.drawString(x, y, str, offset + markStart, endPos - markStart);
|
||||
x = endX;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue