Skip to content

Commit

Permalink
remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wavewave committed Sep 25, 2023
1 parent 7ef89d4 commit aad0e7b
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions daemon/app/ghc-specter-daemon/Render.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import Control.Monad.Extra (ifM, loopM, whenM)
import Control.Monad.IO.Class (MonadIO (..))
import Control.Monad.Trans.Reader (ReaderT (runReaderT))
import Data.Bits ((.|.))
import Data.Foldable (traverse_)
import Data.IORef (newIORef, readIORef, writeIORef)
import Data.List.NonEmpty (NonEmpty)
import Data.Maybe (fromMaybe, isNothing)
Expand Down Expand Up @@ -76,16 +75,14 @@ import Render.TimingView qualified as Timing
import STD.Deletable (delete)
import System.FilePath ((</>))
import Util.GUI
( defTableFlags,
finalize,
( finalize,
globalCursorPosition,
initialize,
makeTabContents,
paintWindow,
showFramerate,
windowFlagsNoScroll,
windowFlagsNone,
windowFlagsScroll,
)
import Util.Render
( SharedState (..),
Expand Down Expand Up @@ -173,7 +170,7 @@ singleFrame io window ui ss oldShared = do
liftIO $
openPopup ("About ghc-specter" :: CString) 0
when newShared.sharedPopup1 $ liftIO $ do
center <- imGuiViewport_GetCenter =<< getMainViewport
center <- imGuiViewport_GetCenter viewport
rel_pos <- newImVec2 0.5 0.5
setNextWindowPos center (fromIntegral (fromEnum ImGuiCond_Appearing)) rel_pos
let flag = fromIntegral (fromEnum ImGuiWindowFlags_AlwaysAutoResize)
Expand All @@ -187,7 +184,7 @@ singleFrame io window ui ss oldShared = do
liftIO $
openPopup ("Help" :: CString) 0
when newShared.sharedPopup2 $ liftIO $ do
center <- imGuiViewport_GetCenter =<< getMainViewport
center <- imGuiViewport_GetCenter viewport
rel_pos <- newImVec2 0.5 0.5
setNextWindowPos center (fromIntegral (fromEnum ImGuiCond_Appearing)) rel_pos
let flag = fromIntegral (fromEnum ImGuiWindowFlags_AlwaysAutoResize)
Expand All @@ -198,7 +195,6 @@ singleFrame io window ui ss oldShared = do
endPopup

-- fullscreen window
viewport <- liftIO getMainViewport
let flags =
fromIntegral $
fromEnum ImGuiWindowFlags_NoDecoration
Expand All @@ -209,21 +205,21 @@ singleFrame io window ui ss oldShared = do
zero <- liftIO $ newImVec2 0 0
liftIO $ setNextWindowPos pos 0 zero
liftIO $ setNextWindowSize size 0
liftIO $ begin ("fullscreen" :: CString) nullPtr flags
_ <- liftIO $ begin ("fullscreen" :: CString) nullPtr flags

-- start splitter
let (w, h) = newShared.sharedLeftPaneSize
liftIO $ pushStyleVar2 (fromIntegral (fromEnum ImGuiStyleVar_ItemSpacing)) zero
child1_size <- liftIO $ newImVec2 (realToFrac w) (realToFrac h)
liftIO $ beginChild ("Compilation Status" :: CString) child1_size (fromBool True) 0
_ <- liftIO $ beginChild ("Compilation Status" :: CString) child1_size (fromBool True) 0
Session.renderCompilationStatus ss
liftIO endChild
liftIO $ delete child1_size
--
liftIO sameLine_
--
vsplitter_size <- liftIO $ newImVec2 8.0 (realToFrac h)
liftIO $ invisibleButton ("vsplitter" :: CString) vsplitter_size 0
_ <- liftIO $ invisibleButton ("vsplitter" :: CString) vsplitter_size 0
delta_x <-
ifM
(toBool <$> liftIO isItemActive)
Expand Down Expand Up @@ -262,7 +258,7 @@ singleFrame io window ui ss oldShared = do
liftIO $ endChild
--
hsplitter_size <- liftIO $ newImVec2 (-1.0) 8.0
liftIO $ invisibleButton ("hsplitter" :: CString) hsplitter_size 0
_ <- liftIO $ invisibleButton ("hsplitter" :: CString) hsplitter_size 0
delta_y <-
ifM
(toBool <$> liftIO isItemActive)
Expand Down

0 comments on commit aad0e7b

Please sign in to comment.