make LaunchBrowser better

This commit is contained in:
ouwou 2020-12-17 21:07:12 -05:00
parent 58d0424dfc
commit 776c350eb6
4 changed files with 8 additions and 13 deletions

View File

@ -13,6 +13,7 @@ find_library(GTKMM_LIBRARY gtkmm)
include_directories(${GTKMM_INCLUDE_DIRS})
find_library(GLIB_LIBRARY glib-2.0)
find_library(GTK_LIBRARY gtk-3.0)
find_path(GLIBMM_INCLUDE_DIRS glibmm.h)
find_library(GLIBMM_LIBRARY glibmm)
@ -91,6 +92,7 @@ target_link_libraries(abaddon ${ATKMM_LIBRARY})
target_link_libraries(abaddon ${CURL_LIBRARY})
target_link_libraries(abaddon ${CPR_LIBRARY})
target_link_libraries(abaddon ${ZLIB_LIBRARY})
target_link_libraries(abaddon ${GTK_LIBRARY})
if(NOT DISABLE_MBEDTLS)
target_link_libraries(abaddon ${MBEDTLS_TLS_LIBRARY})
target_link_libraries(abaddon ${MBEDTLS_X509_LIBRARY})

View File

@ -39,6 +39,8 @@ for:
after_build:
- cmd: |
copy "c:\tools\vcpkg\installed\x64-windows\tools\glib\gspawn-win64-helper.exe" "%APPVEYOR_BUILD_FOLDER%\build\%CONFIGURATION%\gspawn-win64-helper.exe"
copy "c:\tools\vcpkg\installed\x64-windows\tools\glib\gspawn-win64-helper-console.exe" "%APPVEYOR_BUILD_FOLDER%\build\%CONFIGURATION%\gspawn-win64-helper-console.exe"
xcopy /E /I %APPVEYOR_BUILD_FOLDER%\css "%APPVEYOR_BUILD_FOLDER%\build\%CONFIGURATION%\css\"
xcopy /E /I %APPVEYOR_BUILD_FOLDER%\res "%APPVEYOR_BUILD_FOLDER%\build\%CONFIGURATION%\res\"
7z a %APPVEYOR_BUILD_FOLDER%\out\abaddon.zip "%APPVEYOR_BUILD_FOLDER%\build\%CONFIGURATION%"

View File

@ -768,8 +768,6 @@ bool ChatMessageItemContainer::OnLinkClick(GdkEventButton *ev) {
}
return false;
return false;
}
void ChatMessageItemContainer::ShowMenu(GdkEvent *event) {

View File

@ -54,17 +54,10 @@ private:
#include <shellapi.h>
#endif
inline void LaunchBrowser(std::string url) {
#if defined(_WIN32)
// wtf i love the win32 api now ???
ShellExecuteA(NULL, "open", url.c_str(), NULL, NULL, SW_SHOWNORMAL);
#elif defined(__APPLE__)
std::system(("open " + url).c_str());
#elif defined(__linux__)
std::system(("xdg-open " + url).c_str());
#else
printf("can't open url on this platform\n");
#endif
inline void LaunchBrowser(Glib::ustring url) {
GError *err = nullptr;
if (!gtk_show_uri_on_window(nullptr, url.c_str(), GDK_CURRENT_TIME, &err))
printf("failed to open uri: %s\n", err->message);
}
inline void GetImageDimensions(int inw, int inh, int &outw, int &outh, int clampw = 400, int clamph = 300) {