Skip to content

Commit

Permalink
Icons update
Browse files Browse the repository at this point in the history
  • Loading branch information
cipres authored and cipres committed Jan 12, 2021
1 parent f2ae2df commit 0532a70
Show file tree
Hide file tree
Showing 26 changed files with 72 additions and 66 deletions.
6 changes: 2 additions & 4 deletions galacteek/core/glogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,8 @@ class LogRecordStyler:

# ui
'galacteek.ui': {
'basecolor': 'white',
'blue': -0.2,
'red': -0.1,
'green': -0.5
'basecolor': 'darkred',
'red': -0.2
},

# hashmarks
Expand Down
5 changes: 4 additions & 1 deletion galacteek/did/ipid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,9 +1127,12 @@ async def didAuthPerform(self, ipfsop, streamCtx, ipid, token=None):
req['ident_token'] = token

try:
# log.debug(f'didAuthPerform, sending request: {req}')

async with streamCtx.session as session:
async with session.post(
streamCtx.httpUrl('/auth')) as resp:
streamCtx.httpUrl('/auth'),
data=json.dumps(req)) as resp:
if resp.status != HTTPOk.status_code:
payload = await resp.json()
log.debug(f'Error payload: {payload}')
Expand Down
4 changes: 0 additions & 4 deletions galacteek/ui/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2247,10 +2247,6 @@ def onLoadProgress(self, progress):
self.ui.stopButton.setEnabled(progress >= 0 and progress < 100)

if progress == 100:
self.ui.pBarBrowser.setStyleSheet(
'''QProgressBar::chunk#pBarBrowser {
background-color: #244e66;
}''')
self.loop.call_later(
1,
self.ui.pBarBrowser.setStyleSheet,
Expand Down
6 changes: 4 additions & 2 deletions galacteek/ui/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@


# Used by the DAG viewer
dagLinkColor = QColor(212, 184, 116)
unixfsNodeColor = QColor('#C3D7DF')
# dagLinkColor = QColor(212, 184, 116)
# unixfsNodeColor = QColor('#C3D7DF')
dagLinkColor = QColor('#4a9ea1')
unixfsNodeColor = QColor('#121212')
rawLeafColor = QColor('lightgreen')

ipfsColor1 = QColor('#4b9fa2')
Expand Down
10 changes: 5 additions & 5 deletions galacteek/ui/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1461,18 +1461,18 @@ def log(self, text):
def progress(self, p: int):
self.pBar.setValue(p)

def paintEvent(self, event):
def paintEventNoNeed(self, event):
from PyQt5.QtGui import QPainter, QPen

center = self.rect().center()
w, h = 420, 420 # it's a coincidence

painter = QPainter(self)

# b = QBrush(desertStrikeColor, Qt.SolidPattern)
# painter.setBrush(b)
# painter.fillRect(self.rect(), b)
# painter.setBrush(QBrush(brownColor1, Qt.SolidPattern))
b = QBrush(desertStrikeColor, Qt.SolidPattern)
painter.setBrush(b)
painter.fillRect(self.rect(), b)
painter.setBrush(QBrush(brownColor1, Qt.SolidPattern))

painter.setPen(QPen(ipfsColor1, 2, Qt.SolidLine))
painter.drawEllipse(center.x() - w / 2, center.y() - h / 2, w, h)
Expand Down
29 changes: 9 additions & 20 deletions galacteek/ui/dwebspace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from galacteek import partialEnsure
from galacteek import ensure
from galacteek import log
from galacteek import cached_property

from galacteek.core.ps import KeyListener
from galacteek.core.ps import makeKeyService
Expand Down Expand Up @@ -640,35 +641,23 @@ async def workspaceSwitched(self):
self.fileManagerTab.fileManager.updateTree()


class WorkspaceMultimedia(TabbedWorkspace):
class WorkspaceMultimedia(SingleWidgetWorkspace):
def __init__(self, stack):
super().__init__(stack, WS_MULTIMEDIA, icon=getIcon('multimedia.png'),
super().__init__(stack, WS_MULTIMEDIA, icon=getIcon('mediaplayer.png'),
description='Multimedia',
acceptsDrops=True)

@cached_property
def mPlayer(self):
return mediaplayer.MediaPlayerTab(self.app.mainWindow)

def setupWorkspace(self):
super().setupWorkspace()

self.mpAction = self.wsAddCustomAction(
'mplayer', self.wsIcon,
iMediaPlayer(),
self.onAddMplayerTab, default=True)
self.wLayout.addWidget(self.mPlayer)

def mPlayerTab(self):
tab = self.wsFindTabWithName(iMediaPlayer())
if tab:
return tab
else:
tab = mediaplayer.MediaPlayerTab(self.app.mainWindow)

if tab.playerAvailable():
self.wsRegisterTab(
tab, self.mpAction.text(), icon=self.wsIcon,
current=True)
return tab

def onAddMplayerTab(self):
return self.mPlayerTab()
return self.mPlayer

async def handleObjectDrop(self, ipfsPath):
tab = self.mPlayerTab()
Expand Down
7 changes: 4 additions & 3 deletions galacteek/ui/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -1273,12 +1273,12 @@ async def publish(op, oHash, keyName):
# Media player actions
if nameItem.isFile():
actionsMenu.addAction(
getIcon('multimedia.png'),
getIcon('mediaplayer.png'),
iMediaPlayerQueue(), partialEnsure(
self.mediaPlayerQueueFile, str(ipfsPath)))
elif nameItem.isDir():
actionsMenu.addAction(
getIcon('multimedia.png'),
getIcon('mediaplayer.png'),
iMediaPlayerQueue(), partialEnsure(
self.mediaPlayerQueueDir, str(ipfsPath)))

Expand Down Expand Up @@ -1602,7 +1602,8 @@ def statusEmpty(self):
self.ui.mfsStatusLabel.setText('')

def onAddFilesClicked(self):
dialog = QFileDialog(None)
# dialog = QFileDialog(None)
dialog = QFileDialog(self)
dialog.setFileMode(QFileDialog.ExistingFiles)

dialog.filesSelected.connect(
Expand Down
2 changes: 1 addition & 1 deletion galacteek/ui/galacteek.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
<file>../../share/icons/folder-music.png</file>
<file>../../share/icons/folder-documents.png</file>
<file>../../share/icons/file-manager.png</file>
<file>../../share/icons/multimedia.png</file>
<file>../../share/icons/mediaplayer.png</file>
<file>../../share/icons/clear-all.png</file>
<file>../../share/icons/go-next.png</file>
<file>../../share/icons/hashmarks.png</file>
Expand Down
2 changes: 1 addition & 1 deletion galacteek/ui/mainui.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ def __init__(self, app):
if self.app.windowsSystem:
self.restartAction.setEnabled(False)

self.mPlayerOpenAction = QAction(getIcon('multimedia.png'),
self.mPlayerOpenAction = QAction(getIcon('mediaplayer.png'),
iMediaPlayer(),
triggered=self.onOpenMediaPlayer)

Expand Down
2 changes: 1 addition & 1 deletion galacteek/ui/peers.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def data(self, column, role):
if column == 1:
return self.ctx.ipid.did

elif role == Qt.BackgroundRole:
elif role == Qt.BackgroundRole and 0:
if self.ctx.ipid.local:
color = QColor('#cce4ff')
else:
Expand Down
19 changes: 18 additions & 1 deletion galacteek/ui/themes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import attr
import subprocess
from pathlib import Path
import importlib
Expand Down Expand Up @@ -57,7 +58,18 @@ def __init__(self):
self.app = runningApp()
self.fsWatcher = FileWatcher()

self.fsWatcher.pathChanged.connect(self.onThemeChanged)

def onThemeChanged(self, path: str):
tp = Path(path)
self.themeApply(tp.name)

# self.app.repolishWidget(self.app.mainWindow)

def change(self, theme):
self.themeApply(theme)

def themeApply(self, theme):
libFontsPath = pkgResourcesRscFilename(
'galacteek.ui.themes', 'fonts.qss'
)
Expand Down Expand Up @@ -91,7 +103,6 @@ def change(self, theme):

sysName = self.app.system.lower()
qssPath = f":/galacteek/ui/themes/{theme}/galacteek.qss"
# qssPath = f":/theme_{theme}/galacteek.qss"
qssPlatformPath = \
f":/galacteek/ui/themes/{theme}/galacteek_{sysName}.qss"

Expand All @@ -110,4 +121,10 @@ def change(self, theme):
if style:
self.app.setStyle(style)

self.fsWatcher.watch(themeDir)
return True


@attr.s(auto_attribs=True)
class Theme:
name: str = None
44 changes: 22 additions & 22 deletions galacteek/ui/themes/moon3/galacteek.qss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

QToolTip
{
border: 1px solid black;
Expand Down Expand Up @@ -754,7 +755,6 @@ QLabel
margin-left: 2px;
margin-right: 2px;
color: #D1DBCB;

}

QTabWidget{
Expand Down Expand Up @@ -968,6 +968,11 @@ QTreeView, QListView
background-color: #1e1e1e;
}

QTreeView:branch
{
background-color: #1e1e1e;
}

/*
QTreeView:branch:selected, QTreeView:branch:hover
{
Expand Down Expand Up @@ -1274,15 +1279,6 @@ QSplitter::handle:vertical {
height: 1px;
}

QProgressBar {
border: 1px solid #76797C;
border-radius: 5px;
text-align: center;
}

QProgressBar::chunk {
/* background-color: #D1DBCB; */
}

QDateEdit
{
Expand Down Expand Up @@ -1332,7 +1328,6 @@ QDateEdit::down-arrow:focus
image: url(:/theme_icons/rc/down_arrow.png);
}


/* G */

QTreeView {
Expand Down Expand Up @@ -1376,7 +1371,14 @@ QToolBar#mainToolBar QToolButton {
min-height: 32px;
}

/* Progressbar +/
/* Progressbar */

QProgressBar {
border: 1px solid #76797C;
border-radius: 5px;
text-align: center;
background-color: #323232;
}

QProgressBar:horizontal {
border: 1px solid gray;
Expand All @@ -1391,39 +1393,39 @@ QProgressBar::chunk:horizontal {

QProgressBar#pBarBrowser {
text-align: center;
color: black;
background-color: transparent;
border-radius: 5px;
border: 0;
}

QProgressBar::chunk#pBarBrowser {
background-color: #7f8491;
}



QTreeView#historySearchResults {
font: 12pt "Inter UI";
}


QLabel#statusProgressLabel {
font: 14pt "Inter UI";
font-weight: bold;
color: #D1DBCB;
}


QLineEdit#urlZone {
font: 13pt "Inter UI";
margin-left: 4px;
padding: 2px;
}

QLineEdit#urlZone::hover {
border: 1px solid #4a9ea1;
}


QWidget#logsTextWindow {
background-color: #4a9ea1;
}



QTextEdit#logsTextWidget {
background-color: #E0DEDE;
font: 12pt "Inter UI";
Expand Down Expand Up @@ -1486,5 +1488,3 @@ QToolBar QToolButton::pressed {
QPlainTextEdit#markdownTextEdit {
background-color: #F0F7F7;
}


2 changes: 1 addition & 1 deletion galacteek/ui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ class IconSelector(QComboBox):
':/share/icons/ipld-logo.png',
':/share/icons/pyramid-aqua.png',
':/share/icons/pyramid-stack.png',
':/share/icons/multimedia.png',
':/share/icons/mediaplayer.png',
':/share/icons/folder-documents.png',
':/share/icons/folder-pictures.png',
':/share/icons/orbitdb.png',
Expand Down
Binary file modified share/icons/add-file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified share/icons/add-folder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified share/icons/blog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified share/icons/clipboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified share/icons/folder-open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified share/icons/hashmark-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified share/icons/hashmarks-library.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified share/icons/helmet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified share/icons/information.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added share/icons/mediaplayer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified share/icons/peers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified share/icons/pin-curve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified share/icons/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0532a70

Please sign in to comment.