Skip to content

Commit 35b4e32

Browse files
committed
Add "Highlight all hints". v2.3.0
1 parent 2311696 commit 35b4e32

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
from __future__ import division, print_function
2020

21-
__version__ = '2.2.0'
21+
__version__ = '2.3.0'
2222

2323
import sys
2424
import os.path
@@ -56,7 +56,7 @@ class Color(object):
5656
light_text = QColor(255, 255, 255)
5757
dark_text = QColor(73, 73, 73)
5858
border = qt.white
59-
beam = QColor(220, 220, 220, 140)
59+
beam = QColor(220, 220, 220, 160)
6060
flower = QColor(220, 220, 220, 128)
6161
flower_border = QColor(128, 128, 128, 192)
6262
revealed_border = QColor(0, 255, 128)

editor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,9 @@ def drawBackground(self, g, rect):
421421
if self.hexcells_ui:
422422
pts = [(-13.837, 8.321), (-13.837, -4.232), (-9.843, -8.274), (11.713, -8.274), (11.713, -5.421), (13.837, -5.421), (13.837, 8.321)]
423423
poly = QPolygonF([rect.center() + QPointF(*p) for p in pts])
424-
g.setPen(QPen(qt.gray, 0))
424+
pen = QPen(qt.gray, 1)
425+
pen.setCosmetic(True)
426+
g.setPen(pen)
425427
g.drawPolygon(poly)
426428

427429

player.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def drawForeground(self, g, rect):
194194
g.drawPolygon(poly)
195195

196196
g.setBrush(QBrush(qt.NoBrush))
197-
pen = QPen(Color.flower_border, 2)
197+
pen = QPen(Color.flower_border, 1.5)
198198
pen.setCosmetic(True)
199199
g.setPen(pen)
200200
for it in self.all(Cell):
@@ -303,6 +303,15 @@ def undo(self):
303303
found = True
304304
if not found:
305305
self.undo()
306+
307+
def highlight_all_columns(self):
308+
for col in self.all(Column):
309+
if not col.hidden:
310+
col.beam = True
311+
def highlight_all_flowers(self):
312+
for cell in self.all(Cell):
313+
if not cell.hidden and cell.display is Cell.full and cell.value is not None:
314+
cell.flower = True
306315

307316

308317
class View(common.View):
@@ -431,7 +440,11 @@ def __init__(self, playtest=False):
431440
menu.addAction("&Clear Annotations", self.scene.clear_guesses, QKeySequence("X"))
432441
menu.addAction("Con&firm Annotated Guesses", self.scene.confirm_guesses, QKeySequence("C"))
433442
menu.addAction("&Deny Annotated Guesses", self.scene.confirm_opposite_guesses, QKeySequence("D"))
443+
menu.addSeparator()
434444

445+
menu.addAction("Highlight All C&olumn Hints", self.scene.highlight_all_columns)
446+
menu.addAction("Highlight All F&lower Hints", self.scene.highlight_all_flowers)
447+
435448

436449
menu = self.menuBar().addMenu("&Solve")
437450
menu.setEnabled(solve is not None)

0 commit comments

Comments
 (0)