mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-04 20:46:28 +01:00
make cell line width settable
This commit is contained in:
parent
e19f1042cb
commit
b49792c750
4 changed files with 28 additions and 11 deletions
|
@ -468,13 +468,11 @@ public class BoardCanvas extends Canvas implements DrawCtx {
|
||||||
// frame the cell
|
// frame the cell
|
||||||
int frameColor = m_otherColors[CommonPrefs.COLOR_CELLLINE];
|
int frameColor = m_otherColors[CommonPrefs.COLOR_CELLLINE];
|
||||||
m_strokePaint.setColor( adjustColor(frameColor) );
|
m_strokePaint.setColor( adjustColor(frameColor) );
|
||||||
if ( false ) {
|
|
||||||
// PENDING: fetch/calculate this a lot less frequently!!
|
// PENDING: fetch/calculate this a lot less frequently!!
|
||||||
int linePct = XWPrefs.getPrefsInt( m_activity, R.string.key_board_line_pct, 1 );
|
int width = XWPrefs.getPrefsInt( m_activity, R.string.key_board_line_width, 1 );
|
||||||
linePct = Math.min( 25, linePct );
|
|
||||||
int width = Math.max(1, (rect.width() * linePct) / 100);
|
|
||||||
m_strokePaint.setStrokeWidth( width );
|
m_strokePaint.setStrokeWidth( width );
|
||||||
}
|
|
||||||
drawRect( rect, m_strokePaint );
|
drawRect( rect, m_strokePaint );
|
||||||
|
|
||||||
drawCrosshairs( rect, flags );
|
drawCrosshairs( rect, flags );
|
||||||
|
@ -779,7 +777,7 @@ public class BoardCanvas extends Canvas implements DrawCtx {
|
||||||
m_fillPaint.setTextAlign( align );
|
m_fillPaint.setTextAlign( align );
|
||||||
drawText( text, origin, bottom, m_fillPaint );
|
drawText( text, origin, bottom, m_fillPaint );
|
||||||
}
|
}
|
||||||
} // drawCentered
|
} // drawIn
|
||||||
|
|
||||||
private void drawScaled( String text, final Rect rect,
|
private void drawScaled( String text, final Rect rect,
|
||||||
Rect textBounds, int descent )
|
Rect textBounds, int descent )
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
<string name="key_cellline">key_cellline</string>
|
<string name="key_cellline">key_cellline</string>
|
||||||
<string name="key_clr_crosshairs">key_clr_crosshairs</string>
|
<string name="key_clr_crosshairs">key_clr_crosshairs</string>
|
||||||
<string name="key_clr_bonushint">key_clr_bonushint</string>
|
<string name="key_clr_bonushint">key_clr_bonushint</string>
|
||||||
<string name="key_board_line_pct">key_board_line_pct</string>
|
<string name="key_board_line_width">key_board_line_width</string>
|
||||||
|
|
||||||
<string name="key_relay_host">key_relay_host</string>
|
<string name="key_relay_host">key_relay_host</string>
|
||||||
<string name="key_relay_port">key_relay_port2</string>
|
<string name="key_relay_port">key_relay_port2</string>
|
||||||
|
@ -194,6 +194,15 @@
|
||||||
<item>9</item>
|
<item>9</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="cellline_widths">
|
||||||
|
<item>1</item>
|
||||||
|
<item>2</item>
|
||||||
|
<item>3</item>
|
||||||
|
<item>4</item>
|
||||||
|
<item>6</item>
|
||||||
|
<item>8</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
<string-array name="phony_names">
|
<string-array name="phony_names">
|
||||||
<item>@string/phonies_ignore</item>
|
<item>@string/phonies_ignore</item>
|
||||||
<item>@string/phonies_warn</item>
|
<item>@string/phonies_warn</item>
|
||||||
|
|
|
@ -881,7 +881,7 @@
|
||||||
############################################################
|
############################################################
|
||||||
-->
|
-->
|
||||||
<!-- title of this sub-preference -->
|
<!-- title of this sub-preference -->
|
||||||
<string name="prefs_colors">Board colors</string>
|
<string name="prefs_colors">Board colors etc.</string>
|
||||||
<!-- clarification of the above -->
|
<!-- clarification of the above -->
|
||||||
<string name="prefs_colors_summary">Edit colors used on the board</string>
|
<string name="prefs_colors_summary">Edit colors used on the board</string>
|
||||||
<!-- The remaining strings (down to the color edit dialog below)
|
<!-- The remaining strings (down to the color edit dialog below)
|
||||||
|
@ -913,7 +913,8 @@
|
||||||
board -->
|
board -->
|
||||||
<string name="key_bonushint">Bonus square text</string>
|
<string name="key_bonushint">Bonus square text</string>
|
||||||
<!-- The color of the lines delimiting cells on the board -->
|
<!-- The color of the lines delimiting cells on the board -->
|
||||||
<string name="cellline">Board lines</string>
|
<string name="cellline">Cell borders</string>
|
||||||
|
<string name="cellline_width">Cell border width</string>
|
||||||
<!--
|
<!--
|
||||||
############################################################
|
############################################################
|
||||||
# :Dialogs:
|
# :Dialogs:
|
||||||
|
|
|
@ -81,5 +81,14 @@
|
||||||
android:title="@string/cellline"
|
android:title="@string/cellline"
|
||||||
android:defaultValue="0x101010"
|
android:defaultValue="0x101010"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<org.eehouse.android.xw4.XWListPreference
|
||||||
|
android:key="@string/key_board_line_width"
|
||||||
|
android:title="@string/cellline_width"
|
||||||
|
android:entries="@array/cellline_widths"
|
||||||
|
android:entryValues="@array/cellline_widths"
|
||||||
|
android:defaultValue="2"
|
||||||
|
/>
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|
Loading…
Add table
Reference in a new issue