mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-21 19:35:49 +08:00
Merge branch 'main' of https://github.com/iDescriptor/iDescriptor
This commit is contained in:
@@ -158,7 +158,6 @@ jobs:
|
|||||||
"libgstosxaudio"
|
"libgstosxaudio"
|
||||||
"libgstplayback"
|
"libgstplayback"
|
||||||
"libgstvolume"
|
"libgstvolume"
|
||||||
"libgstfaad"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
for plugin in "${PLUGINS[@]}"; do
|
for plugin in "${PLUGINS[@]}"; do
|
||||||
@@ -167,32 +166,47 @@ jobs:
|
|||||||
|
|
||||||
cp "$(brew --prefix gstreamer)/libexec/gstreamer-1.0/gst-plugin-scanner" "build/iDescriptor.app/Contents/Frameworks/"
|
cp "$(brew --prefix gstreamer)/libexec/gstreamer-1.0/gst-plugin-scanner" "build/iDescriptor.app/Contents/Frameworks/"
|
||||||
|
|
||||||
# Bundle FFmpeg libraries
|
|
||||||
FFMPEG_LIBS=(
|
|
||||||
"libavcodec.61.dylib"
|
|
||||||
"libavformat.61.dylib"
|
|
||||||
"libavutil.59.dylib"
|
|
||||||
"libswresample.5.dylib"
|
|
||||||
"libswscale.8.dylib"
|
|
||||||
"libavfilter.11.dylib"
|
|
||||||
)
|
|
||||||
|
|
||||||
for lib in "${FFMPEG_LIBS[@]}"; do
|
|
||||||
if [ -f "$(brew --prefix ffmpeg)/lib/${lib}" ]; then
|
|
||||||
cp "$(brew --prefix ffmpeg)/lib/${lib}" build/iDescriptor.app/Contents/Frameworks/
|
|
||||||
install_name_tool -id "@rpath/${lib}" "build/iDescriptor.app/Contents/Frameworks/${lib}"
|
|
||||||
else
|
|
||||||
echo "Warning: ${lib} not found"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Bundle libjxl_cms
|
# Bundle libjxl_cms
|
||||||
cp "$(brew --prefix)/lib/libjxl_cms.0.11.dylib" build/iDescriptor.app/Contents/Frameworks/
|
cp "$(brew --prefix)/lib/libjxl_cms.0.11.dylib" build/iDescriptor.app/Contents/Frameworks/
|
||||||
install_name_tool -id "@rpath/libjxl_cms.0.11.dylib" build/iDescriptor.app/Contents/Frameworks/libjxl_cms.0.11.dylib
|
install_name_tool -id "@rpath/libjxl_cms.0.11.dylib" build/iDescriptor.app/Contents/Frameworks/libjxl_cms.0.11.dylib
|
||||||
install_name_tool -change "$(brew --prefix)/lib/libjxl_cms.0.11.dylib" "@rpath/libjxl_cms.0.11.dylib" build/iDescriptor.app/Contents/Frameworks/libjxl.0.11.dylib
|
install_name_tool -change "$(brew --prefix)/lib/libjxl_cms.0.11.dylib" "@rpath/libjxl_cms.0.11.dylib" build/iDescriptor.app/Contents/Frameworks/libjxl.0.11.dylib
|
||||||
|
|
||||||
|
# Add rpath to main executable
|
||||||
install_name_tool -add_rpath "@executable_path/../Frameworks" build/iDescriptor.app/Contents/MacOS/iDescriptor
|
install_name_tool -add_rpath "@executable_path/../Frameworks" build/iDescriptor.app/Contents/MacOS/iDescriptor
|
||||||
|
|
||||||
|
# Fix GStreamer library paths
|
||||||
|
FRAMEWORKS_DIR="build/iDescriptor.app/Contents/Frameworks"
|
||||||
|
BREW_PREFIX="$(brew --prefix)"
|
||||||
|
|
||||||
|
# For some reason libavfilter sometimes doesnt get copied by macdeployqt
|
||||||
|
FFMPEG_LIB_DIR="$(brew --prefix ffmpeg)/lib"
|
||||||
|
cp ${FFMPEG_LIB_DIR}/libavfilter.11.dylib "${FRAMEWORKS_DIR}/"
|
||||||
|
|
||||||
|
# Fix dependencies in all GStreamer plugins
|
||||||
|
for plugin in "${GST_PLUGIN_DIR}"/*.dylib; do
|
||||||
|
echo "Fixing plugin: $(basename ${plugin})"
|
||||||
|
|
||||||
|
# Get all dependencies and fix them
|
||||||
|
otool -L "${plugin}" | grep -E "${BREW_PREFIX}" | awk '{print $1}' | while read dep; do
|
||||||
|
depname=$(basename "${dep}")
|
||||||
|
echo " Changing ${depname}"
|
||||||
|
install_name_tool -change "${dep}" "@rpath/${depname}" "${plugin}" 2>/dev/null || true
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
# Fix dependencies in GStreamer core libraries themselves
|
||||||
|
for lib in "${FRAMEWORKS_DIR}"/libgst*.dylib "${FRAMEWORKS_DIR}"/libglib*.dylib "${FRAMEWORKS_DIR}"/libgobject*.dylib "${FRAMEWORKS_DIR}"/libgmodule*.dylib "${FRAMEWORKS_DIR}"/libgio*.dylib "${FRAMEWORKS_DIR}"/libgthread*.dylib; do
|
||||||
|
if [ -f "${lib}" ]; then
|
||||||
|
echo "Fixing library: $(basename ${lib})"
|
||||||
|
|
||||||
|
otool -L "${lib}" | grep -E "${BREW_PREFIX}" | awk '{print $1}' | while read dep; do
|
||||||
|
depname=$(basename "${dep}")
|
||||||
|
echo " Changing ${depname}"
|
||||||
|
install_name_tool -change "${dep}" "@rpath/${depname}" "${lib}" 2>/dev/null || true
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
- name: Create DMG
|
- name: Create DMG
|
||||||
run: |
|
run: |
|
||||||
create-dmg \
|
create-dmg \
|
||||||
|
|||||||
Binary file not shown.
+37
-37
@@ -95,30 +95,32 @@ void DiskUsageWidget::setupUI()
|
|||||||
m_diskBarLayout->setContentsMargins(0, 0, 0, 0);
|
m_diskBarLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
m_diskBarLayout->setSpacing(0);
|
m_diskBarLayout->setSpacing(0);
|
||||||
|
|
||||||
// Create colored segments
|
/*
|
||||||
#ifdef Q_OS_MAC
|
FIXME: There is bug with qt, related to NSPopover on macOS
|
||||||
m_systemBar = new DiskUsageBar();
|
need to revisit this when we find a fix
|
||||||
m_appsBar = new DiskUsageBar();
|
*/
|
||||||
m_mediaBar = new DiskUsageBar();
|
// #ifdef Q_OS_MAC
|
||||||
m_othersBar = new DiskUsageBar();
|
// m_systemBar = new DiskUsageBar();
|
||||||
m_freeBar = new DiskUsageBar();
|
// m_appsBar = new DiskUsageBar();
|
||||||
|
// m_mediaBar = new DiskUsageBar();
|
||||||
|
// m_othersBar = new DiskUsageBar();
|
||||||
|
// m_freeBar = new DiskUsageBar();
|
||||||
|
|
||||||
m_systemBar->setStyleSheet(
|
// m_systemBar->setStyleSheet(
|
||||||
" background-color: #a1384d; border: 1px solid"
|
// " background-color: #a1384d; border: 1px solid"
|
||||||
"#e64a5b; padding: 0; margin: 0; border-top-left-radius: 3px; "
|
// "#e64a5b; padding: 0; margin: 0; border-top-left-radius: 3px; "
|
||||||
"border-bottom-left-radius: 3px; ");
|
// "border-bottom-left-radius: 3px; ");
|
||||||
m_appsBar->setStyleSheet("background-color: #4f869f; border: 1px solid "
|
// m_appsBar->setStyleSheet("background-color: #4f869f; border: 1px solid "
|
||||||
"#63b4da; padding: 0; margin: 0; ");
|
// "#63b4da; padding: 0; margin: 0; ");
|
||||||
m_mediaBar->setStyleSheet("background-color: #2ECC71; "
|
// m_mediaBar->setStyleSheet("background-color: #2ECC71; "
|
||||||
"border: none; padding: 0; margin: 0; ");
|
// "border: none; padding: 0; margin: 0; ");
|
||||||
m_othersBar->setStyleSheet("background-color: #a28729; border: 1px solid "
|
// m_othersBar->setStyleSheet("background-color: #a28729; border: 1px solid "
|
||||||
"#c4a32d; padding: 0; margin: 0; ");
|
// "#c4a32d; padding: 0; margin: 0; ");
|
||||||
m_freeBar->setStyleSheet(
|
// m_freeBar->setStyleSheet(
|
||||||
"background-color: #6e6d6d; border: 1px solid "
|
// "background-color: #6e6d6d; border: 1px solid "
|
||||||
"#4f4f4f; padding: 0; margin: 0; border-top-right-radius: 3px; "
|
// "#4f4f4f; padding: 0; margin: 0; border-top-right-radius: 3px; "
|
||||||
"border-bottom-right-radius: 3px; ");
|
// "border-bottom-right-radius: 3px; ");
|
||||||
|
|
||||||
#else
|
|
||||||
m_systemBar = new QWidget();
|
m_systemBar = new QWidget();
|
||||||
m_appsBar = new QWidget();
|
m_appsBar = new QWidget();
|
||||||
m_mediaBar = new QWidget();
|
m_mediaBar = new QWidget();
|
||||||
@@ -154,7 +156,6 @@ void DiskUsageWidget::setupUI()
|
|||||||
m_mediaBar->setContentsMargins(0, 0, 0, 0);
|
m_mediaBar->setContentsMargins(0, 0, 0, 0);
|
||||||
m_othersBar->setContentsMargins(0, 0, 0, 0);
|
m_othersBar->setContentsMargins(0, 0, 0, 0);
|
||||||
m_freeBar->setContentsMargins(0, 0, 0, 0);
|
m_freeBar->setContentsMargins(0, 0, 0, 0);
|
||||||
#endif
|
|
||||||
|
|
||||||
m_diskBarLayout->addWidget(m_systemBar);
|
m_diskBarLayout->addWidget(m_systemBar);
|
||||||
m_diskBarLayout->addWidget(m_appsBar);
|
m_diskBarLayout->addWidget(m_appsBar);
|
||||||
@@ -317,19 +318,19 @@ void DiskUsageWidget::updateUI()
|
|||||||
m_diskBarLayout->setStretchFactor(m_othersBar, othersStretch);
|
m_diskBarLayout->setStretchFactor(m_othersBar, othersStretch);
|
||||||
m_diskBarLayout->setStretchFactor(m_freeBar, freeStretch);
|
m_diskBarLayout->setStretchFactor(m_freeBar, freeStretch);
|
||||||
|
|
||||||
// Set usage info for popovers
|
/* FIXME: NSPopover bug */
|
||||||
#ifdef Q_OS_MAC
|
// #ifdef Q_OS_MAC
|
||||||
m_systemBar->setUsageInfo("System", formatSize(m_systemUsage), "#a1384d",
|
// m_systemBar->setUsageInfo("System", formatSize(m_systemUsage), "#a1384d",
|
||||||
(double)m_systemUsage / m_totalCapacity);
|
// (double)m_systemUsage / m_totalCapacity);
|
||||||
m_appsBar->setUsageInfo("Apps", formatSize(m_appsUsage), "#3498DB",
|
// m_appsBar->setUsageInfo("Apps", formatSize(m_appsUsage), "#3498DB",
|
||||||
(double)m_appsUsage / m_totalCapacity);
|
// (double)m_appsUsage / m_totalCapacity);
|
||||||
m_mediaBar->setUsageInfo("Media", formatSize(m_mediaUsage), "#2ECC71",
|
// m_mediaBar->setUsageInfo("Media", formatSize(m_mediaUsage), "#2ECC71",
|
||||||
(double)m_mediaUsage / m_totalCapacity);
|
// (double)m_mediaUsage / m_totalCapacity);
|
||||||
m_othersBar->setUsageInfo("Others", formatSize(m_othersUsage), "#F39C12",
|
// m_othersBar->setUsageInfo("Others", formatSize(m_othersUsage), "#F39C12",
|
||||||
(double)m_othersUsage / m_totalCapacity);
|
// (double)m_othersUsage / m_totalCapacity);
|
||||||
m_freeBar->setUsageInfo("Free", formatSize(m_freeSpace), "#BDC3C7",
|
// m_freeBar->setUsageInfo("Free", formatSize(m_freeSpace), "#BDC3C7",
|
||||||
(double)m_freeSpace / m_totalCapacity);
|
// (double)m_freeSpace / m_totalCapacity);
|
||||||
#else
|
// #else
|
||||||
m_systemBar->setToolTip(
|
m_systemBar->setToolTip(
|
||||||
QString("System: %1 (%2%)")
|
QString("System: %1 (%2%)")
|
||||||
.arg(formatSize(m_systemUsage))
|
.arg(formatSize(m_systemUsage))
|
||||||
@@ -356,7 +357,6 @@ void DiskUsageWidget::updateUI()
|
|||||||
.arg(QString::number((double)m_freeSpace / m_totalCapacity * 100,
|
.arg(QString::number((double)m_freeSpace / m_totalCapacity * 100,
|
||||||
'f', 1)));
|
'f', 1)));
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Hide segments with zero usage
|
// Hide segments with zero usage
|
||||||
// m_systemBar->setVisible(m_systemUsage > 0);
|
// m_systemBar->setVisible(m_systemUsage > 0);
|
||||||
|
|||||||
@@ -65,19 +65,20 @@ private:
|
|||||||
QVBoxLayout *m_dataLayout;
|
QVBoxLayout *m_dataLayout;
|
||||||
QWidget *m_diskBarContainer;
|
QWidget *m_diskBarContainer;
|
||||||
QHBoxLayout *m_diskBarLayout;
|
QHBoxLayout *m_diskBarLayout;
|
||||||
#ifdef Q_OS_MAC
|
/*FIXME: NSPopover bug */
|
||||||
DiskUsageBar *m_systemBar;
|
// #ifdef Q_OS_MAC
|
||||||
DiskUsageBar *m_appsBar;
|
// DiskUsageBar *m_systemBar;
|
||||||
DiskUsageBar *m_mediaBar;
|
// DiskUsageBar *m_appsBar;
|
||||||
DiskUsageBar *m_othersBar;
|
// DiskUsageBar *m_mediaBar;
|
||||||
DiskUsageBar *m_freeBar;
|
// DiskUsageBar *m_othersBar;
|
||||||
#else
|
// DiskUsageBar *m_freeBar;
|
||||||
|
// #else
|
||||||
QWidget *m_systemBar;
|
QWidget *m_systemBar;
|
||||||
QWidget *m_appsBar;
|
QWidget *m_appsBar;
|
||||||
QWidget *m_mediaBar;
|
QWidget *m_mediaBar;
|
||||||
QWidget *m_othersBar;
|
QWidget *m_othersBar;
|
||||||
QWidget *m_freeBar;
|
QWidget *m_freeBar;
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
QHBoxLayout *m_legendLayout;
|
QHBoxLayout *m_legendLayout;
|
||||||
QLabel *m_systemLabel;
|
QLabel *m_systemLabel;
|
||||||
|
|||||||
+2
-2
@@ -62,9 +62,9 @@ int main(int argc, char *argv[])
|
|||||||
QString gstPluginScannerPath =
|
QString gstPluginScannerPath =
|
||||||
QDir::toNativeSeparators(frameworksPath + "/gst-plugin-scanner");
|
QDir::toNativeSeparators(frameworksPath + "/gst-plugin-scanner");
|
||||||
|
|
||||||
qputenv("DYLD_LIBRARY_PATH", frameworksPath.toUtf8());
|
qputenv("GST_PLUGIN_PATH", gstPluginPath.toUtf8());
|
||||||
|
qputenv("GST_PLUGIN_SYSTEM_PATH", gstPluginPath.toUtf8());
|
||||||
qputenv("GST_PLUGIN_SCANNER_1_0", gstPluginScannerPath.toUtf8());
|
qputenv("GST_PLUGIN_SCANNER_1_0", gstPluginScannerPath.toUtf8());
|
||||||
qputenv("GST_PLUGIN_SYSTEM_PATH_1_0", gstPluginPath.toUtf8());
|
|
||||||
#endif
|
#endif
|
||||||
QCoreApplication::setOrganizationName("iDescriptor");
|
QCoreApplication::setOrganizationName("iDescriptor");
|
||||||
QCoreApplication::setApplicationName("iDescriptor");
|
QCoreApplication::setApplicationName("iDescriptor");
|
||||||
|
|||||||
+13
-2
@@ -3,7 +3,18 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
|
||||||
void setupMacOSWindow(QMainWindow *window)
|
void setupMacOSWindow(QMainWindow *window) {
|
||||||
|
window->setUnifiedTitleAndToolBarOnMac(true);
|
||||||
|
|
||||||
|
NSView* nativeView = reinterpret_cast<NSView*>(window->winId());
|
||||||
|
NSWindow* nativeWindow = [nativeView window];
|
||||||
|
|
||||||
|
[nativeWindow setStyleMask:[nativeWindow styleMask] | NSWindowStyleMaskFullSizeContentView | NSWindowTitleHidden];
|
||||||
|
[nativeWindow setTitlebarAppearsTransparent:YES];
|
||||||
|
[nativeWindow center];
|
||||||
|
}
|
||||||
|
// TODO:remove
|
||||||
|
void setupMacOSWindowOLD(QMainWindow *window)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!window) {
|
if (!window) {
|
||||||
@@ -18,7 +29,7 @@ void setupMacOSWindow(QMainWindow *window)
|
|||||||
qWarning() << "setupMacOSWindow: native window is null";
|
qWarning() << "setupMacOSWindow: native window is null";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// TODO: implement theme switching from app settings
|
||||||
// // Force dark mode
|
// // Force dark mode
|
||||||
// nsWindow.overrideUserInterfaceStyle = NSUserInterfaceStyleDark;
|
// nsWindow.overrideUserInterfaceStyle = NSUserInterfaceStyleDark;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user