Dynamically create context menu sub-folders based on folder structure of nodes.
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -113,15 +113,15 @@ class OCRRegionWidget(QWidget):
|
||||
|
||||
def paintEvent(self, event):
|
||||
painter = QPainter(self)
|
||||
pen = QPen(QColor(0, 0, 255))
|
||||
pen.setWidth(3)
|
||||
pen = QPen(QColor(255, 255, 0)) # COLOR OF THE BOX ITSELF
|
||||
pen.setWidth(5) # WIDTH OF THE BOX BORDER
|
||||
painter.setPen(pen)
|
||||
|
||||
# Draw main rectangle
|
||||
painter.drawRect(0, 0, self.width(), self.height())
|
||||
|
||||
# Draw resize handles
|
||||
painter.setBrush(QColor(0, 0, 255))
|
||||
painter.setBrush(QColor(255, 255, 0)) # COLOR OF THE RESIZE HANDLES
|
||||
for handle in self._resize_handles():
|
||||
painter.drawRect(handle)
|
||||
|
||||
|
@@ -31,12 +31,49 @@ def data_api():
|
||||
"""
|
||||
return jsonify(get_data())
|
||||
|
||||
@app.route('/exp')
|
||||
def exp_api():
|
||||
"""
|
||||
Returns the EXP data.
|
||||
"""
|
||||
return jsonify({"exp": get_data()["exp"]})
|
||||
|
||||
@app.route('/hp')
|
||||
def hp_api():
|
||||
"""
|
||||
Returns the HP data.
|
||||
"""
|
||||
return jsonify({
|
||||
"hp_current": get_data()["hp_current"],
|
||||
"hp_total": get_data()["hp_total"]
|
||||
})
|
||||
|
||||
@app.route('/mp')
|
||||
def mp_api():
|
||||
"""
|
||||
Returns the MP data.
|
||||
"""
|
||||
return jsonify({
|
||||
"mp_current": get_data()["mp_current"],
|
||||
"mp_total": get_data()["mp_total"]
|
||||
})
|
||||
|
||||
@app.route('/fp')
|
||||
def fp_api():
|
||||
"""
|
||||
Returns the FP data.
|
||||
"""
|
||||
return jsonify({
|
||||
"fp_current": get_data()["fp_current"],
|
||||
"fp_total": get_data()["fp_total"]
|
||||
})
|
||||
|
||||
def start_api_server():
|
||||
"""
|
||||
Starts the Flask API server in a separate daemon thread.
|
||||
"""
|
||||
def run():
|
||||
app.run(host="127.0.0.1", port=5000)
|
||||
app.run(host="0.0.0.0", port=5000) # Allows external connections
|
||||
t = threading.Thread(target=run, daemon=True)
|
||||
t.start()
|
||||
|
||||
|
Reference in New Issue
Block a user