Skip to content

Commit bce2f6d

Browse files
committed
minor ui tweaks, version 3.5.4
1 parent 5976c15 commit bce2f6d

File tree

1 file changed

+18
-37
lines changed

1 file changed

+18
-37
lines changed

tvhplayer/tvhplayer.py

Lines changed: 18 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
QMenu, QListWidgetItem, QTableWidget, QTableWidgetItem, QHeaderView, QTabWidget, QTextEdit, QSizePolicy, QToolButton, QShortcut, QCheckBox, QGroupBox # Added QGroupBox here
1212
)
1313
from PyQt5.QtCore import Qt, QSize, QTimer, QPropertyAnimation, QEasingCurve, QAbstractAnimation, QRect, QCoreApplication
14-
from PyQt5.QtGui import QIcon, QPainter, QColor, QKeySequence
14+
from PyQt5.QtGui import QIcon, QPainter, QColor, QKeySequence, QPalette
1515
import json
1616
import requests
1717
# Replace this line:
@@ -448,12 +448,21 @@ def setup_ui(self):
448448
self.password_input = QLineEdit()
449449
self.password_input.setEchoMode(QLineEdit.Password)
450450

451+
# Style placeholder text
452+
placeholder_color = QColor(100, 100, 100) # Dark gray color
453+
palette = self.palette()
454+
palette.setColor(QPalette.PlaceholderText, placeholder_color)
455+
self.setPalette(palette)
456+
457+
# Apply placeholder text
451458
layout.addRow("Name:", self.name_input)
452459
self.name_input.setPlaceholderText("My Server")
453460
layout.addRow("Server address:", self.url_input)
454461
self.url_input.setPlaceholderText("http://127.0.0.1:9981")
455462
layout.addRow("Username:", self.username_input)
463+
self.username_input.setPlaceholderText("Optional")
456464
layout.addRow("Password:", self.password_input)
465+
self.password_input.setPlaceholderText("Optional")
457466

458467
buttons = QDialogButtonBox(
459468
QDialogButtonBox.Ok | QDialogButtonBox.Cancel
@@ -1359,6 +1368,13 @@ def custom_show_message(message, timeout=0):
13591368
search_layout = QHBoxLayout()
13601369
search_icon = QLabel("🔍") # Unicode search icon
13611370
self.search_box = QLineEdit()
1371+
1372+
# Style placeholder text
1373+
placeholder_color = QColor(100, 100, 100) # Dark gray color
1374+
search_palette = self.search_box.palette()
1375+
search_palette.setColor(QPalette.PlaceholderText, placeholder_color)
1376+
self.search_box.setPalette(search_palette)
1377+
13621378
self.search_box.setPlaceholderText("Press S to search channels...")
13631379
self.search_box.textChanged.connect(self.filter_channels)
13641380
self.search_box.setClearButtonEnabled(True) # Add clear button inside search box
@@ -1376,42 +1392,7 @@ def custom_show_message(message, timeout=0):
13761392
left_layout.addLayout(search_layout) # Add to left pane layout
13771393

13781394
# Now style the search box with custom clear button styling
1379-
self.search_box.setStyleSheet("""
1380-
QLineEdit {
1381-
padding: 6px;
1382-
padding-right: 25px; /* Make room for clear button */
1383-
border: 1px solid #ccc;
1384-
border-radius: 4px;
1385-
background-color: white;
1386-
}
1387-
QLineEdit:focus {
1388-
border-color: #0078d4;
1389-
}
1390-
QLineEdit::placeholder {
1391-
color: #555;
1392-
font-weight: bold;
1393-
opacity: 0.8;
1394-
}
1395-
QLineEdit QToolButton { /* Style for the clear button */
1396-
background: none;
1397-
border: none;
1398-
padding: 0px 6px;
1399-
color: #666;
1400-
font-size: 16px;
1401-
}
1402-
QLineEdit QToolButton:hover {
1403-
background-color: #e0e0e0;
1404-
border-radius: 2px;
1405-
}
1406-
""")
14071395

1408-
# Style the search icon
1409-
search_icon.setStyleSheet("""
1410-
QLabel {
1411-
color: #666;
1412-
padding: 0 5px;
1413-
}
1414-
""")
14151396

14161397
# Add margins to search layout
14171398
search_layout.setContentsMargins(0, 5, 0, 5)
@@ -1900,7 +1881,7 @@ def show_about(self):
19001881
about_text = (
19011882
"<div style='text-align: center;'>"
19021883
"<h2>TVHplayer</h2>"
1903-
"<p>Version 3.5.3</p>"
1884+
"<p>Version 3.5.4</p>"
19041885
"<p>A powerful and user-friendly TVHeadend client application.</p>"
19051886
"<p style='margin-top: 20px;'><b>Created by:</b><br>mFat</p>"
19061887
"<p style='margin-top: 20px;'><b>Built with:</b><br>"

0 commit comments

Comments
 (0)