makes the wire tool tips optional, closes #297

This commit is contained in:
hneemann 2019-08-12 11:30:01 +02:00
parent 58540f28f2
commit 87a78f23a8
5 changed files with 24 additions and 12 deletions

View File

@ -795,5 +795,11 @@ public final class Keys {
public static final Key<Boolean> SETTINGS_SHOW_TUTORIAL = public static final Key<Boolean> SETTINGS_SHOW_TUTORIAL =
new Key<>("showTutorial", true).setSecondary(); new Key<>("showTutorial", true).setSecondary();
/**
* Enables the wire tool tips
*/
public static final Key<Boolean> SETTINGS_WIRETOOLTIP =
new Key<>("wireToolTips", false);
} }

View File

@ -52,6 +52,7 @@ public final class Settings implements AttributeListener {
intList.add(Keys.SETTINGS_GRID); intList.add(Keys.SETTINGS_GRID);
intList.add(Keys.SETTINGS_SHOW_WIRE_BITS); intList.add(Keys.SETTINGS_SHOW_WIRE_BITS);
intList.add(Keys.SETTINGS_NOTOOLTIPS); intList.add(Keys.SETTINGS_NOTOOLTIPS);
intList.add(Keys.SETTINGS_WIRETOOLTIP);
intList.add(Keys.SETTINGS_LIBRARY_PATH); intList.add(Keys.SETTINGS_LIBRARY_PATH);
intList.add(Keys.SETTINGS_JAR_PATH); intList.add(Keys.SETTINGS_JAR_PATH);
intList.add(Keys.SETTINGS_ATF1502_FITTER); intList.add(Keys.SETTINGS_ATF1502_FITTER);

View File

@ -551,20 +551,21 @@ public class CircuitComponent extends JComponent implements ChangedListener, Lib
if (v != null) if (v != null)
return v.getValueString(); return v.getValueString();
else { else {
if (highLighted == null || highLighted.isEmpty() || toolTipHighlighted) { if (Settings.getInstance().get(Keys.SETTINGS_WIRETOOLTIP))
try { if (highLighted == null || highLighted.isEmpty() || toolTipHighlighted) {
if (toolTipNetList == null) try {
toolTipNetList = new NetList(getCircuit()); if (toolTipNetList == null)
Net n = toolTipNetList.getNetOfPos(w.p1); toolTipNetList = new NetList(getCircuit());
if (n != null) { Net n = toolTipNetList.getNetOfPos(w.p1);
removeHighLighted(); if (n != null) {
addHighLighted(n.getWires()); removeHighLighted();
toolTipHighlighted = true; addHighLighted(n.getWires());
toolTipHighlighted = true;
}
} catch (PinException e) {
e.printStackTrace();
} }
} catch (PinException e) {
e.printStackTrace();
} }
}
} }
} }

View File

@ -1213,6 +1213,8 @@ Sind evtl. die Namen der Variablen nicht eindeutig?</string>
</string> </string>
<string name="key_grid">Raster anzeigen</string> <string name="key_grid">Raster anzeigen</string>
<string name="key_grid_tt">Zeigt im Hauptfenster ein Raster an, um das platzieren der Elemente zu erleichtern.</string> <string name="key_grid_tt">Zeigt im Hauptfenster ein Raster an, um das platzieren der Elemente zu erleichtern.</string>
<string name="key_wireToolTips">Leitungen als ToolTip</string>
<string name="key_wireToolTips_tt">Wenn gesetzt, werden Leitungen hervorgehoben, wenn die Maus darauf zeigt.</string>
<string name="key_mapToKey">Auf Tastatur legen</string><!-- Button --> <string name="key_mapToKey">Auf Tastatur legen</string><!-- Button -->
<string name="key_mapToKey_tt">Taste wird durch die Tastatur bedienbar. Um die Cursor-Tasten zu nutzen, kann als <string name="key_mapToKey_tt">Taste wird durch die Tastatur bedienbar. Um die Cursor-Tasten zu nutzen, kann als
Bezeichnung UP, DOWN, LEFT oder RIGHT verwendet werden.</string> Bezeichnung UP, DOWN, LEFT oder RIGHT verwendet werden.</string>

View File

@ -1200,6 +1200,8 @@
It must be ensured that the names of all files in this folder and all subfolders are unique.</string> It must be ensured that the names of all files in this folder and all subfolders are unique.</string>
<string name="key_grid">Show Grid</string> <string name="key_grid">Show Grid</string>
<string name="key_grid_tt">Shows a grid in the main window.</string> <string name="key_grid_tt">Shows a grid in the main window.</string>
<string name="key_wireToolTips">Wire tool tips</string>
<string name="key_wireToolTips_tt">If set, lines are highlighted when the mouse hovers over them.</string>
<string name="key_mapToKey">Map to keyboard</string><!-- Button --> <string name="key_mapToKey">Map to keyboard</string><!-- Button -->
<string name="key_mapToKey_tt">Button is mapped to the keyboard. <string name="key_mapToKey_tt">Button is mapped to the keyboard.
To use the cursor keys use UP, DOWN, LEFT or RIGHT as label.</string> To use the cursor keys use UP, DOWN, LEFT or RIGHT as label.</string>